4 ms·
As mentioned in the article, this isn't limited to ruby. It just shows that the ruby timeout can be dangerous, which a great reminder to those who use it. It wo
by mrinterweb 2y ago
As mentioned in the article, this isn't limited to ruby. It just shows that the ruby timeout can be dangerous, which a great reminder to those who use it. It would be great if the danger was mentioned in ruby's Timeout class documentation.
The same type of danger can be encountered with the linux `kill` command, depending on which signal you send, losing power, operating system terminate, etc. If you have state in flux, hard killing a process can have unexpected outcomes.
I'd also like to say that just because something is dangerous, doesn't mean it should not be used. Just use it carefully. Think of it as dynamite. Dynamite is very useful in some cases, and always needs to be handled with care.