Skip to content

Commit

Permalink
Add a few debugging lines and include the fix in the webhooks library.
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidtw committed Aug 11, 2017
1 parent b17e22a commit 9d389b8
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 44 deletions.
10 changes: 10 additions & 0 deletions src/caduceus/outboundSender.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ func (osf OutboundSenderFactory) New() (obs OutboundSender, err error) {
// specified time. The new delivery cutoff time must be after the previously
// set delivery cutoff time.
func (obs *CaduceusOutboundSender) Extend(until time.Time) {

obs.mutex.Lock()
if until.After(obs.deliverUntil) {
obs.deliverUntil = until
Expand Down Expand Up @@ -270,6 +271,7 @@ func (obs *CaduceusOutboundSender) QueueJSON(req CaduceusRequest,
contentType: "application/json",
}
outboundReq.req.Telemetry.TimeOutboundAccepted = time.Now()
obs.logger.Trace("JSON Sent to obs queue [%s]\n", obs.listener.Config.URL)
obs.queue <- outboundReq
} else {
obs.queueOverflow()
Expand Down Expand Up @@ -337,12 +339,18 @@ func (obs *CaduceusOutboundSender) QueueWrp(req CaduceusRequest, metaData map[st
}
outboundReq.req.Telemetry.TimeOutboundAccepted = time.Now()
obs.queue <- outboundReq
obs.logger.Trace("WRP Sent to obs queue [%s]\n", obs.listener.Config.URL)
} else {
obs.queueOverflow()
}
}
} else {
obs.logger.Trace(fmt.Sprintf("Regex did not match. got != expected: '%s' != '%s'\n", eventType, eventRegex.String()))
}
}
} else {
obs.logger.Trace("Outside delivery window.\n")
obs.logger.Trace(fmt.Sprintf("now: %s, before: %s, after: %s\n", now.String(), deliverUntil.String(), dropUntil.String()))
}
}

Expand Down Expand Up @@ -415,6 +423,8 @@ func (obs *CaduceusOutboundSender) queueOverflow() {
obs.dropUntil = time.Now().Add(obs.cutOffPeriod)
obs.mutex.Unlock()

obs.logger.Trace("queue overflowed for [%s]\n", obs.listener.Config.URL)

msg, err := json.Marshal(obs.failureMsg)
if nil != err {
obs.logger.Error("Cut-off notification json.Marshal( %v ) failed for %s, err: %s", obs.failureMsg, obs.listener.Config.URL, err)
Expand Down
84 changes: 42 additions & 42 deletions src/glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/glide.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package: .
import:
- package: github.com/Comcast/webpa-common
version: 0ed5d670f2e9fd8047e21f3765d4b0f5c7895a31
version: 353718a8846ab788342ab804b68ce39898949bd7
subpackages:
- concurrent
- handler
- logging
- secure
- server
- webhook
- webhook

0 comments on commit 9d389b8

Please sign in to comment.