elsa icon indicating copy to clipboard operation
elsa copied to clipboard

Always restart non-group worker processes that exited abnormally

Open jtrees opened this issue 1 year ago • 1 comments

The new behaviour is less surprising and consistent with the way group consumer workers behave.

Fixes #104

jtrees avatar Apr 25 '23 10:04 jtrees

@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.

jtrees avatar May 10 '23 09:05 jtrees