resque: unexpected EOF on client connection

Hello,

we have noticed a lot of :

2011-08-24 15:24:00 CEST LOG:  could not receive data from client: Connection reset by peer
2011-08-24 15:24:00 CEST LOG:  unexpected EOF on client connection

in our log. After some digging, the disconnections are coming from resque. Sounds like everytime a job is done, the worker doesn’t close nicely the connection.

This issue is related to #306 : we have to establish a connection on forking. I’ve tried to disconnect cleanly in done_working, but the working is dying when doing that. Any idea ?

About this issue

  • Original URL
  • State: closed
  • Created 13 years ago
  • Reactions: 1
  • Comments: 38 (9 by maintainers)

Most upvoted comments

I’m seeing the exact behavior @kellyfelkins describes after upgrading my PostgreSQL plan on Heroku. It’s possible this was happening before as well, but wasn’t getting logged - either way I’d love to know if anyone resolves it.

I was running into the same issue on Heroku and wrote a gem to fix it. Disconnecting from the db in Worker#done_working didn’t work for me either, but it does work in an after_perform callback in the job. The reason is because after_perform is called inside the thread where done_working is back in the parent process.

Here’s the gem… https://github.com/simple10/resque-heroku

No more “unexpected EOF on client connection” after installing it.