From 9d389b8cd2c52fa2cc3cc1e7511e0471b73aa5d9 Mon Sep 17 00:00:00 2001 From: Weston Schmidt Date: Fri, 11 Aug 2017 00:25:31 -0700 Subject: [PATCH] Add a few debugging lines and include the fix in the webhooks library. --- src/caduceus/outboundSender.go | 10 ++++ src/glide.lock | 84 +++++++++++++++++----------------- src/glide.yaml | 4 +- 3 files changed, 54 insertions(+), 44 deletions(-) diff --git a/src/caduceus/outboundSender.go b/src/caduceus/outboundSender.go index a2cd2563..9269890a 100644 --- a/src/caduceus/outboundSender.go +++ b/src/caduceus/outboundSender.go @@ -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 @@ -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() @@ -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())) } } @@ -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) diff --git a/src/glide.lock b/src/glide.lock index 89833e8e..6e6c76a1 100644 --- a/src/glide.lock +++ b/src/glide.lock @@ -1,77 +1,76 @@ -hash: 8f3a27b2a32b957fa88707451d57ff034b9019e4724c632fc2ddc40275d71456 -updated: 2017-08-10T13:31:20.391322189-07:00 +hash: 3b168260089b279a968d159824ac4b21c5a790b02a1a3e50e6f9dbc2dc6d92fd +updated: 2017-08-11T00:08:29.431798521-07:00 imports: - name: github.com/aws/aws-sdk-go version: 7be45195c3af1b54a609812f90c05a7e492e2491 subpackages: - aws - - service - - aws/credentials - - aws/session - - service/sns - - service/sns/snsiface - aws/awserr - - aws/endpoints + - aws/awsutil - aws/client + - aws/client/metadata - aws/corehandlers + - aws/credentials + - aws/credentials/ec2rolecreds + - aws/credentials/endpointcreds - aws/credentials/stscreds - aws/defaults + - aws/ec2metadata + - aws/endpoints - aws/request - - aws/awsutil - - aws/client/metadata + - aws/session - aws/signer/v4 - private/protocol - private/protocol/query - - service/sts - - aws/credentials/ec2rolecreds - - aws/credentials/endpointcreds - - aws/ec2metadata - - private/protocol/rest - private/protocol/query/queryutil + - private/protocol/rest - private/protocol/xml/xmlutil + - service/sns + - service/sns/snsiface + - service/sts - name: github.com/c9s/goprocinfo version: 19cb9f127a9c8d2034cf59ccb683cdb94b9deb6c subpackages: - linux - name: github.com/Comcast/webpa-common - version: 0ed5d670f2e9fd8047e21f3765d4b0f5c7895a31 + version: 353718a8846ab788342ab804b68ce39898949bd7 subpackages: - concurrent - handler + - health + - httperror - logging + - logging/golog + - resource - secure - - server - - webhook - - health - secure/handler - secure/key - - wrp - - resource + - server - types - - logging/golog - - httperror + - webhook - webhook/aws + - wrp - name: github.com/davecgh/go-spew version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9 subpackages: - spew - name: github.com/fsnotify/fsnotify - version: 4da3e2cfbabc9f751898f250b49f2439785783a1 + version: a904159b9206978bb6d53fcc7a769e5cd726c737 - name: github.com/go-ini/ini - version: 3d73f4b845efdf9989fffd4b4e562727744a34ba + version: d3de07a94d22b4a0972deb4b96d790c2c0ce8333 - name: github.com/gorilla/context version: 08b5f424b9271eedf6f9f0ce86cb9396ed337a42 - name: github.com/gorilla/mux version: 392c28fe23e1c45ddba891b0320b3b5df220beea - name: github.com/hashicorp/hcl - version: 392dba7d905ed5d04a5794ba89f558b27e2ba1ca + version: 372e8ddaa16fd67e371e9323807d056b799360af subpackages: - hcl/ast - hcl/parser - - hcl/token - - json/parser - hcl/scanner - hcl/strconv + - hcl/token + - json/parser - json/scanner - json/token - name: github.com/ian-kent/go-log @@ -86,15 +85,17 @@ imports: - name: github.com/jtacoma/uritemplates version: 307ae868f90f4ee1b73ebe4596e0394237dacce8 - name: github.com/justinas/alice - version: 1051eaf52fcafdd87ead59d28b065f1fcb8274ec + version: 052b8b6c18edb9db317af86806d8e00ebaa94160 - name: github.com/magiconair/properties - version: be5ece7dd465ab0765a9682137865547526d1dfb + version: b3b15ef068fd0b17ddf408a23669f20811d194d2 - name: github.com/mitchellh/mapstructure - version: d0303fe809921458f417bcf828397a65db30a7e4 + version: db1efb556f84b25a0a13a04aad883943538ad2e0 +- name: github.com/pelletier/go-buffruneio + version: df1e16fde7fc330a0ca68167c23bf7ed6ac31d6d - name: github.com/pelletier/go-toml - version: 69d355db5304c0f7f809a2edc054553e7142f016 + version: d1fa2118c12c44e4f5004da216d1efad10cb4924 - name: github.com/philhofer/fwd - version: 1612a298117663d7bc9a760ae20d383413859798 + version: 98c11a7a6ec829d672b03833c3d69a7fae1ca972 - name: github.com/pmezard/go-difflib version: d8ed2627bdf02c080bf22230dbb337003b7aba2d subpackages: @@ -106,13 +107,13 @@ imports: - jws - jwt - name: github.com/spf13/afero - version: 9be650865eab0c12963d8753212f4f9c66cdcf12 + version: 72b31426848c6ef12a7a8e216708cb0d1530f074 subpackages: - mem - name: github.com/spf13/cast - version: acbeb36b902d72a7a4c18e8f3241075e7ab763e4 + version: d1139bab1c07d5ad390a65e7305876b3c1a8370b - name: github.com/spf13/jwalterweatherman - version: 0efa5202c04663c757d84f90f5219c1250baf94f + version: fa7ca7e836cf3a8bb4ebf799f472c12d7e903d66 - name: github.com/spf13/pflag version: 9ff6c6923cfffbcd502984b8e0c80539a94968b7 - name: github.com/spf13/viper @@ -123,9 +124,8 @@ imports: version: 69483b4bd14f5845b5a1e55bca19e954e827f1d0 subpackages: - assert - - require - mock - - linux + - require - name: github.com/t-k/fluent-logger-golang version: 0f8ec08f2057a61574b6943e75045fffbeae894e subpackages: @@ -139,14 +139,14 @@ imports: subpackages: - codec - name: golang.org/x/sys - version: e42485b6e20ae7d2304ec72e535b103ed350cc02 + version: 7a6e5648d140666db5d920909e082ca00a87ba2c subpackages: - unix - name: golang.org/x/text - version: b19bf474d317b857955b12035d2c5acb57ce8b01 + version: 506f9d5c962f284575e88337e7d9296d27e729d3 subpackages: - transform - unicode/norm - name: gopkg.in/yaml.v2 - version: 25c4ec802a7d637f88d584ab26798e94ad14c13b -devImports: [] + version: 4c78c975fe7c825c6d1466c42be594d1d6f3aba6 +testImports: [] diff --git a/src/glide.yaml b/src/glide.yaml index 6139e20c..16717d33 100644 --- a/src/glide.yaml +++ b/src/glide.yaml @@ -1,11 +1,11 @@ package: . import: - package: github.com/Comcast/webpa-common - version: 0ed5d670f2e9fd8047e21f3765d4b0f5c7895a31 + version: 353718a8846ab788342ab804b68ce39898949bd7 subpackages: - concurrent - handler - logging - secure - server - - webhook \ No newline at end of file + - webhook