Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker loop does not restore after redis disconnects #36

Closed
stansv opened this issue Oct 12, 2019 · 2 comments
Closed

Worker loop does not restore after redis disconnects #36

stansv opened this issue Oct 12, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@stansv
Copy link
Contributor

stansv commented Oct 12, 2019

Scenario

  1. run Redis on localhost:6379 and create a Worker with default options and no-op processing callback
  2. Worker call brpoplpush with default rate determined by drainDelay (5 secs)
  3. Stop redis gracefully or kill -9

The ECONNREFUSED will appear (I've also added some logging to trace each brpoplpush)

BRPOPLPUSH at 2019-10-12T09:22:26.934Z
BRPOPLPUSH at 2019-10-12T09:22:31.950Z
Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1126:14) {
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
<the same message appears again from time to time>
  1. Start Redis
  2. New error messages still appears, Worker doesn't try to take new jobs from queue

UPD. I've spent some more time on debugging this. What's not good is that brpoplpush() call does not return control on such error, i.e. the promise returned neither resolves nor rejects.

@manast manast added the bug Something isn't working label Oct 20, 2019
@manast
Copy link
Contributor

manast commented Oct 20, 2019

so you mean that brpoplpush does never resolve or fail when the connection fails?

@stansv
Copy link
Contributor Author

stansv commented Nov 7, 2019

Yes, brpoplpush() neither resolves nor rejects as I can see.. probably there some hidden timeout so maybe it would be rejected if I'd wait more time. Need to check ioredis implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants