You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My team and I were wondering whether it is dangerous to use the Timeout.timeout method as demonstrated in README.md. We have come across several articles explaining that using this method puts you at risk:
So we got curious as to why there is no mention of the risks in the README even though you seem to know about them (#19)! Is there something that would make you consider the risks here are acceptable? We would love to have your input on this 👂
I just took a peek at other librairies that offer a timeout feature:
Yes, it is dangerous to use Timeout.timeout in GoodJob. That's because GoodJob, like Puma, is multithreaded and Thread.raise/kill can leave shared resources (like Active Record database connection pool) in uncertain states.
we got curious as to why there is no mention of the risks in the README
Simply overlooked on my part. I think I wrote that in the very early days of GoodJob and that section is inadequate today. I think my thinking there was that if your code is safe to be wrapped in a Timeout.timeout then it's safe for GoodJob too... which is true, but doesn't mention that it's very, very, very likely that your code isn't safe to do that.
Hello there! 👋
First of all, thank you for this great gem, it solves many problems that we have and it is wonderfully documented. 😍
This issue is kind of a followup to #19.
My team and I were wondering whether it is dangerous to use the
Timeout.timeout
method as demonstrated in README.md. We have come across several articles explaining that using this method puts you at risk:So we got curious as to why there is no mention of the risks in the README even though you seem to know about them (#19)! Is there something that would make you consider the risks here are acceptable? We would love to have your input on this 👂
I just took a peek at other librairies that offer a timeout feature:
Timeout.timeout
Most librairies don't offer that feature, for good reasons I presume.
Thank you so much for your time! 🙏
The text was updated successfully, but these errors were encountered: