TwP / servolux

Threads : Servers : Forks : Daemons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`rescue nil` is widely used

djanowski opened this issue · comments

rescue nil shouldn't be used in general but is used extensively in Servolux.

For example, I just spent 20 minutes debugging an issue because Servolux::Prefork was hiding all exceptions from me.

It's just not a good practice and shouldn't be used in a library.

If we agree, I can provide a patch to remove all 21 cases where this is used.

I agree that any servolux code that calls back to a user defined method should have better error handling than just "rescue nil". However, any internal servolux calls that use "rescue nil" should be fine. Mostly these are shutdown cases (where I don't care if something errors) or interprocess communication over sockets (where I don't want a message hiccup to crash the program).

The case you mention in Prefork should be changed -- calling before_executing and after_executing. Those errors should be propagated back to the parent process.

Patches are welcome. Thanks for using Servolux.