-
-
Notifications
You must be signed in to change notification settings - Fork 507
observed HAProxy/Redis/Sentinel error on short timeouts or disconnect #490
Conversation
When HAProxy timeout is set to a very short value, or when connecting directly to Redis and Redis dies, observed the following exception: Error: Callback was already called. at /usr/src/thing-proxy/node_modules/ponte/node_modules/async/lib/async.js:43:36 at /usr/src/thing-proxy/node_modules/ponte/lib/ponte.js:42:7 at /usr/src/thing-proxy/node_modules/ponte/node_modules/mosca/lib/persistence/redis.js:161:11 at /usr/src/thing-proxy/node_modules/ponte/node_modules/async/lib/async.js:52:16 at Object.async.forEachOf.async.eachOf (/usr/src/thing-proxy/node_modules/ponte/node_modules/async/lib/async.js:236:30) at Object.async.forEach.async.each (/usr/src/thing-proxy/node_modules/ponte/node_modules/async/lib/async.js:209:22) [...]
There is a failing test on the Redis persistence: https://travis-ci.org/mcollina/mosca/jobs/136546187#L1059-L1075. https://github.com/mcollina/mosca/blob/master/test/persistence/abstract.js#L336-L351 |
@mcollina This version appears to be failing tests regardless of the minor change I've made here. If i revert those changes, the tests still fail for me. Thoughts? |
how does that fails? with the same reason? |
Yes, unfortunately.
|
BTW... the bit in the test file
During the failure results = undefined |
Then probably it's related to one of the dep changed. Can you update the PR to handle that? |
is err set? |
Nope. No err. err: null, results: undefined |
Can you please have a look and fix that as well? |
The oddness here is that https://github.com/mcollina/mosca/blob/master/lib/persistence/redis.js#L338-L344 the multi.get doesn't seem to be executing, thus resulting in a non err with an undefined response. Any clue why this would be happening? Has all of this redis code been reworked with the pull requests that use ioredis.js instead of redis.js? And if I explicitly check for !responses in the cb(err, responses) call, subsequent tests involving the presence of objects like:
... fail. It seems to be that something fundamental the tests has recently changed and caused these failures. |
something changed in the dependency tree, not in Mosca or Ascoltatori :(. That PR will be part of v2, because it's switching to ioredis, and that needs some time for me to solve issues there. You can definitely help (we need to revert a PR that was using a lua script, see #464). |
When HAProxy timeout is set to a very short value, or when connecting directly to Redis and Redis dies, observed the following exception:
Error: Callback was already called.
at /usr/src/thing-proxy/node_modules/ponte/node_modules/async/lib/async.js:43:36
at /usr/src/thing-proxy/node_modules/ponte/lib/ponte.js:42:7
at /usr/src/thing-proxy/node_modules/ponte/node_modules/mosca/lib/persistence/redis.js:161:11
at /usr/src/thing-proxy/node_modules/ponte/node_modules/async/lib/async.js:52:16
at Object.async.forEachOf.async.eachOf (/usr/src/thing-proxy/node_modules/ponte/node_modules/async/lib/async.js:236:30)
at Object.async.forEach.async.each (/usr/src/thing-proxy/node_modules/ponte/node_modules/async/lib/async.js:209:22)
[...]