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

Queue retry not configurable #415

Closed
glensc opened this issue Aug 7, 2020 · 1 comment
Closed

Queue retry not configurable #415

glensc opened this issue Aug 7, 2020 · 1 comment

Comments

@glensc
Copy link
Contributor

glensc commented Aug 7, 2020

  const queue = new Queue({ connection: connectionDetails }, jobs);
  queue.on("error", function (error) {
    console.log('queue error:', error);
  });
  await queue.connect();
  const result = await queue.enqueue("math", "add", [1, 2]);
  console.log(result);

Seems if redis is down queue.enqueue will retry forever, not even having timeout and throwing exception. just doing one queue.enqueue, starts to spam:

queue error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
queue error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
queue error Error: connect ECONNREFUSED 127.0.0.1:6379
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 6379
}
@evantahler
Copy link
Member

You may want to then configure the retryStrategy of ioredis - https://github.com/luin/ioredis#auto-reconnect. This should be passed in as part of connectionDetails. You can see what Actionhero does here: https://github.com/actionhero/actionhero/blob/18bba71893800491a7a710cb9c6a219d59ca7838/src/config/redis.ts#L37-L44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants