添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
不敢表白的小摩托  ·  Developer Community·  2 月前    · 
腹黑的板凳  ·  Gartner reafirma a ...·  3 月前    · 
小胡子的匕首  ·  Evolve Tone | ...·  6 月前    · 

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

Hello there,
we are using bull(mq)/redis for our queues. Recently our redis seems to be unreachable every other day for a few seconds. Now we are trying to prevent this error to crash our application. If I understood the documentation correctly, the error events should be emitted silently and not cause any harm.

We get these errors

[ioredis] Unhandled error event: Error: connect ETIMEDOUT
at processTimers (internal/timers.js:497:7)
at Socket.EventEmitter.emit (domain.js:483:12)
at Socket.emit (events.js:314:20)
at Object.onceWrapper (events.js:420:28)
at Socket.<anonymous> (/app/node_modules/ioredis/built/redis/index.js:317:37)
at processTimers (internal/timers.js:497:7)
Error: connect ETIMEDOUT
at Socket.<anonymous> (/app/node_modules/ioredis/built/redis/index.js:317:37)
at Socket.emit (events.js:314:20)
at Object.onceWrapper (events.js:420:28)
at Socket._onTimeout (net.js:483:8)
at RedisConnection.emit (events.js:314:20)

Until now, we were calling our redis just with the connection url.

new Redis(url)

After some investigation we tried to use reconnectOnError from this documentation. But we still get the error from above.

new Redis(url, {
  reconnectOnError (err) {
    const targetError = 'ETIMEDOUT'
    if (err.message.includes(targetError)) {
      return 1 

4.27.7 - is our ioredis version
12.19 - is our node version

Are we missing something? Is this a known issue? How can we prevent this error?

Thanks in advance

ioredis does emit errors silently. Isn't that what you've encountered?

No, I have noticed ETIMEDOUT crashes the whole process. I am on v5.3.1

Currently investigating the same issue, did you find a way to safely handle this? @pSnehanshu