[erlang-questions] Erlang shell crashes

Jay Nelson jay@REDACTED
Mon Oct 30 00:23:09 CET 2006


Sean suggested:

> The solution is probably as simple as using gen_server:call instead  
> of gen_server:cast.


Also verify that for every message send (i.e., Pid ! Msg) there is somewhere
that you receive the message.  If you are using receive patterns that do not
match up, messages will accumulate that can never be removed.

You should also use a catch all message to remove any messages you were not expecting:

receive
  {From, expected_msg, Data} ->
        do_something(Data);
  AnyUnexpectedMsg ->
        log_and_skip_handling(AnyUnexpectedMsg)
end.


jay





More information about the erlang-questions mailing list