Recovering from ECONNRESET (tcp socket?) error

375 views
Skip to first unread message

Zvi Schutz

unread,
May 28, 2014, 5:51:13 AM5/28/14
to redi...@googlegroups.com
HI There
I have from time to time (once in 2 days) an ECONNRESET error when accessing redis
I am using ruby gem to connect redis.
My recovery scheme is wait 15 seconds and retry with the same ruby client object . This fails consistently for 5 times each time it happens.

I was wondering if "zeroing" the redis object and reopening it will help in this case ? Does it close and open the tcp socket ?
If not is there another possible scheme ?
This is a background process that can wait a few minutes (if it helps)

When the resque task runs again 10-20 minutes after this incident ,  everything works fine.

Best Regards
Zvi

Josiah Carlson

unread,
May 28, 2014, 10:49:13 AM5/28/14
to redi...@googlegroups.com
Have you tried connecting with a different client object?

 - Josiah


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Zvi Schutz

unread,
May 28, 2014, 11:18:43 AM5/28/14
to redi...@googlegroups.com
HI Josiah 
Thanks for your reply. 
No, I did not. That is what I am asking :) 
Should it help ? Maybe I will just try and see if it helps :) Hoped someone encountered the same condition so I could learn from the wise and experienced 

Zvi
You received this message because you are subscribed to a topic in the Google Groups "Redis DB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/redis-db/hMJX0thHBAg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to redis-db+u...@googlegroups.com.

Josiah Carlson

unread,
May 28, 2014, 3:03:10 PM5/28/14
to redi...@googlegroups.com
Whether or not trying a different connection will work will depend on what is the source of the disconnection in the first place. There are essentially countless ways that you can find yourself with a freshly disconnected connection, and only a slightly smaller number of reasons why you wouldn't be able to reconnect with the same client. But if you are able to reconnect with a different client, then you might be able to ignore the cause (and the potentially many hours of debugging) and just keep working on what is more important.

People mostly worry about the "why"-related issues if they've attempted the simple fixes (like trying a different client/connection) and have found that they didn't work.

You jumped the gun a bit ;)

 - Josiah

Reply all
Reply to author
Forward
0 new messages