3 ms·
Well, Ruby will also crash on malformed data; exception handling makes it trivial to recover and continue. Using supervisors to recover by retrying allows you
by lobster_johnson 10y ago
Well, Ruby will also crash on malformed data; exception handling makes it trivial to recover and continue.
Using supervisors to recover by retrying allows you to correct for instability (network faults, oversaturation, locking and such) where a retry might actually fix things. What I am describing is something that cannot be retried in the first place; the next attempt would try to feed the exact same piece of wrongly-typed data back into the supervised process that would then fail again, and so on.
Ruby doesn't have anything like OTP, but these are two different problem spaces. Elixir, as far as I can tell, is open to malformed data/types at runtime in exactly the same way that Ruby is.
- bjz_ 10y agoI like failing fast in the exceptional case where things are out of my control, and OTP is a great platform for doing so, but most of the crashes I get in Erlang/Elixir are purely programmer error, and would be trivial to catch statically.
- dozzie 10y ago> Using supervisors to recover by retrying allows you to correct for instability (network faults, oversaturation, locking and such) [...] Using supervisors to retry operations is going to make your system unstable. Supervision tree is not about handling semi-expected faults, it's about starting things at boot time and restarting them in a predictable manner (along with any dependencies) should any of them crash unexpectedly.
- lobster_johnson 10y agoI agree. It was the parent comment that advocated supervisor trees as a way to mitigate runtime type errors.