New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retry event handler and process manager on error #20
Comments
Maybe skipping the event is not always a viable option depending on the domain. I guess that failing is a must in many scenarios. Maybe there is a bug that has to be fixed and skipping some events leads to inconsistent state. |
@Papipo Skip event on error could be made configurable, either per event handler or globally. |
Could use tarearbol to provide retry logic. |
I see no need for this.
This works great for my own cases (where I hand-built my process managers). Can't see why commanded would not succeed with this simple approach as well. |
@drozzy, I think you talking about scenario when process manager generally fails (all process manager instances are failed), it's definitely should result app crash. And I think proposal about - why crash the whole application if only one specific process manager instance fails? Just submit log, and stop executing bad process manager instance, or try another restart policy (like dropping state or skip event). |
@drozzy Providing an extension point allows consumers of Commanded finer control over how they deal with errors on a case by case basis. So you could decide that for a certain event handler, or particular event, it should retry X times with exponential back-off between retries. Another handler could simply skip any problematic events. You could do this yourself inside an event handler, I'm proposing that Commanded provides a convenient interface for you to use. I don't know exactly what the best strategy is for each use case, therefore make it user configurable. |
Closing this issue. Replaced by #93 to support error handling for process manager command dispatch only. |
Event handlers and process managers are expected to return
:ok
on successful handling of an event. They return{:error, reason}
on failure. In this case the event handler should be retried.Potential error handling options: retry, skip, ignore, stop, or park event.
The text was updated successfully, but these errors were encountered: