Sometimes redis connection timeout

a year ago

node:events:495

      throw er; // Unhandled 'error' event

      ^
 

Error: read ETIMEDOUT

    at TCP.onStreamRead (node:internal/stream_base_commons:217:20)

    at TCP.callbackTrampoline (node:internal/async_hooks:128:17)

Emitted 'error' event on Commander instance at:

    at RedisSocket.<anonymous> (/app/node_modules/@redis/client/dist/lib/client/index.js:422:14)

    at RedisSocket.emit (node:events:517:28)

    at RedisSocket._RedisSocket_onSocketError (/app/node_modules/@redis/client/dist/lib/client/socket.js:218:10)

    at Socket.<anonymous> (/app/node_modules/@redis/client/dist/lib/client/socket.js:191:127)

    at Object.onceWrapper (node:events:632:26)

    at Socket.emit (node:events:517:28)

    at emitErrorNT (node:internal/streams/destroy:151:8)

    at emitErrorCloseNT (node:internal/streams/destroy:116:3)

    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {

  errno: -110,

  code: 'ETIMEDOUT',

  syscall: 'read'

}
 

Node.js v18.20.5

npm warn config production Use `--omit=dev` instead.

Sometime (almost 3~7day / per)my nest.js server was killed by this error and show this error.

$10 Bounty

5 Replies

a year ago

Weird behavior. Can you confirm that Redis was running the entire time? Are you using private networking?


samgordon

Weird behavior. Can you confirm that Redis was running the entire time? Are you using private networking?

a year ago

Sure!

Redis was deployed 44 hours age. but error was erupted 30min ago. (See screenshot 1)

and I'm using private networking (~~~@redis.railway.internal:6379?family=0)


a year ago

screenshot 1

Attachments


hjh010501

Sure! Redis was deployed 44 hours age. but error was erupted 30min ago. (See screenshot 1) and I'm using private networking (\~\~\~@redis.railway.internal:6379?family=0)

smolpaw
HOBBY

a year ago

Which redis library are you using ? node-redis or ioredis ?

Implement a error handler in your redis client so when this error occurs again it doesn't kill the node process.

There can be many reasons why this could be happening. You need to add more debug logs to pinpoint it if it's specific to a command or just general network instability.

Also is your nestjs or redis service have high cpu usage during the crash ?


smolpaw

Which redis library are you using ? node-redis or ioredis ? Implement a error handler in your redis client so when this error occurs again it doesn't kill the node process. There can be many reasons why this could be happening. You need to add more debug logs to pinpoint it if it's specific to a command or just general network instability. Also is your nestjs or redis service have high cpu usage during the crash ?

a year ago

Thank you for your feedback.

I used ioredis, but I think I should write some debug logs to pinpoint the problem.

If I get some any information, I will comment this thread.

appreciate!


Welcome!

Sign in to your Railway account to join the conversation.

Loading...