This PR is much less ambitious than #94 (and so I expect it would be an easier merge). In this case, we just fix the issue when the process is already started, but an error in the resolution of the hostname leads to an incorrect internal state.
Without this patch, the new_state will be :ok, as that is the return from the logger function.
Afterwards, when going to the terminate callback, then we try to call EventHandler.detach(state.handler_ids), which translates to EventHandler.detach(:ok.handler_ids) and fails.
This PR is much less ambitious than #94 (and so I expect it would be an easier merge). In this case, we just fix the issue when the process is already started, but an error in the resolution of the hostname leads to an incorrect internal state.
Without this patch, the
new_state
will be:ok
, as that is the return from the logger function. Afterwards, when going to theterminate
callback, then we try to callEventHandler.detach(state.handler_ids)
, which translates toEventHandler.detach(:ok.handler_ids)
and fails.