sneakers: Alternative timeout mechanism worker operations (the work method)

Hi,

Could you please remove the use of Timeout::timeout from line 55 of worker.rb? This function is inherently unsafe and will potentially ‘randomly’ kill workers.

At the very least, would it be possible to default :timeout_job_after to 0 so that timeouts are switched off by default? Then people can decide for themselves whether they want to run the risks of Timeout::timeout in their code.

I’ve been hit by this a few times now and finally understood what’s going on. Given that the timeout exceptions spring up in random places in my worker code (in fact, deep in some random Rails library) it took a long time to understand that it was actually Sneakers breaking stuff and not my own code. The ability to time out is fairly well hidden in the documentation, so I only found it when I specifically searched for timeout in connection to Sneakers.

Many thanks,

Steffen

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 7
  • Comments: 15 (3 by maintainers)

Commits related to this issue

Most upvoted comments

@michaelklishin I’m OK with removal, I even have a separate local branch with removed timeout, but stuck with tests, because Sneakers uses minitest and rr, which I’m not much familiar with (I’m rspec and rspec-mock fanboy). Unfortunately, I had to switch to Rails app development and stay aside of our async messaging system right now, so I’m not sure I will find the time to fix the subject and adjust docs in the nearest future. I may push my changes and maybe someone could pick up the work.

Anyway I’m happy we have consolidated decision, I guess @szschaler is about the same. Thank you 🙇