Why Ruby’s Timeout is dangerous (and Thread.raise is terrifying)

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 #thread.raise https://www.rubyonrails.ba/single/why-ruby-s-timeout-is-dangerous-and-thread-raise-is-terrifying

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles