Why Ruby’s Timeout is dangerous (and Thread.raise is terrifying)
07-Jun-2024 552
This is already documented in Timeout: Ruby’s most dangerous API. And normally I don’t like making blanket statements about language features. But I had a bad day at work because of this issue. So today, we’re talking about Timeout! :)First! What is Timeout? Let’s say you have a bunch of code, that might be slow. A network request, a long computation, whatever. Ruby’s timeout documentation helpfully saysTimeout provides a way to auto-terminate a potentially long-running operation if it hasn’t finished in a fixed amount of time.
Why Ruby’s Timeout is dangerous (and Thread.raise is terrifying) #ruby #rubydeveloper #rubyonrails #Ruby’s #Timeout #dangerous #Thread.raise #terrifying) #thread.raise https://rubyonrails.ba/link/why-ruby-s-timeout-is-dangerous-and-thread-raise-is-terrifying