elsa
elsa copied to clipboard
Always restart non-group worker processes that exited abnormally
The new behaviour is less surprising and consistent with the way group consumer workers behave.
Fixes #104
@jeffgrunewald You make a good point about the duplicate message handling (and I should update the test to clarify this). The consumer must be built in a way that it can deal with "at least once" delivery.
In my opinion, this is still an acceptable situation. Here are some points that come to mind:
- If the
Elsa.Supervisor
dies and is restarted by the parent supervisor, we run into this situation anyway. We still need to handle it either way. - Currently the failure state (crashed worker) is invisible on the outside (at least via public APIs). Even if an "auto-restart" is undesirable as a default feature, there should at least be some kind of feedback or options to handle the scenario in other ways. I think using an opinionated default (which will work for some folks) is better than the unhandled status quo which (AFAIK) works for no-one.
EDIT: Perhaps making the worker crash trigger a crash of the entire Elsa.Supervisor
is a viable alternative? Then it would be up to the user (of the lib) to decide how to deal with it.