[erlang-questions] Kill process if message mailbox reaches a certain size (was discarding signals)

Mihai Balea mihai@REDACTED
Wed Jun 15 18:02:26 CEST 2011

Hi all,

Was reading the "discarding signals" thread and thought that maybe a better approach to handling this condition would be to kill the process if the mailbox exceeds a certain size.
It seems to me that it would be a cleaner approach than flushing the mailbox and attempting to recover and it also fits better with Erlang's "let it crash" philosophy.

Basically, the way I see it, we'd have this implemented at system level. One could set a flag, similar to, say, fullsweep_after - either per process or system wide. Default could be infinity, which reverts to the current behavior.

Any thoughts on this? Any technical or philosophical arguments, pro or contra?

For the record, I do believe that one should try as hard as possible to avoid getting into this situation to begin with, but occasionally it happens and it is one of Erlang's more spectacular failure modes.


>> If we are talking about an overloaded system that, for any reason, cannot tell the sender to reduce the traffic, then probably the only way to avoid a system crash is to discard the messages and notify the operators (raise an alarm, write event log, etc.) about this. So the discard shall be very quick as we are already overloaded. Do we have something for that?

More information about the erlang-questions mailing list