-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Receiving "Unhandled error event" with error handler #1386
Comments
Yes, I'm seeing this too, w/ sentinels and I wound up at the same place in the code. In my case we are running sentinels in kubernetes and connecting to them directly. If a pod goes down, it'll get recreated, but the IP may have changed, so the connect to the sentinel will start emitting const redis = new Redis({
sentinels: ['host-1:26379', 'host-2:26379', 'host-3:26379']
, name: 'sentinel'
, enableReadyCheck: true
, lazyConnect: true
, enableOfflineQueue: true
, failoverDetector: true
, retryStrategy: () => {
return RECONNECT_TIMEOUT
}
, sentinelRetryStrategy: () => {
return RECONNECT_TIMEOUT
}
, reconnectOnError: (err) => {
/* istanbul ignore if */
if (err.message.includes('READONLY')) {
log.warn({err}, 'readonly event triggered')
return 2
}
}
})
redis.on('error', (err) => {
process.nextTick(() => {
throw err
})
}) For a stand alone connection, I would expect the error handler here to be triggered on these timeout errors. |
hello @esatterwhite can you please tell me what value are you using for |
How to catch connection timeout error? |
In a similar situation as described in #896 and #969, I am receiving the following error.
My code looks like this
From what I can tell, this function has no event listeners defined (count == 0) and is falling into the console.error().
How do I setup the code so that my error handling code will catch this error and it will not hit the console.error() section of code in silentEmit()?
The text was updated successfully, but these errors were encountered: