If the application using EventFlow shuts down unexpectedly, e.g. due to a power failure, EventFlow will lose consistency between what is committed to the event store and what is applied to read models and subscribers as any in-memory updates will be lost.
While any commands published (passed to ICommandBus.PublishAsync) but hasn’t yet resulted in any committed events to the event store are also lost, they are considered out-of-scope for this issue, as EventFlow doesn’t lose consistency.
Possible solutions
- Transaction log: Any events committed to the event store could be written to a log and removed when read models and subscribers have been successfully updated
- others... ?
Mitigation
Steps can be made to minimize the impact that an unexpected shutdown has
- Always drain servers for activity, e.g. web requests, before doing a application shutdown or upgrade
- Use asynchronous subscribers, i.e., let Hangfire (or what ever scheduling you have configured for EventFlow) handle subscriber updates
If the application using EventFlow shuts down unexpectedly, e.g. due to a power failure, EventFlow will lose consistency between what is committed to the event store and what is applied to read models and subscribers as any in-memory updates will be lost.
While any commands published (passed to
ICommandBus.PublishAsync) but hasn’t yet resulted in any committed events to the event store are also lost, they are considered out-of-scope for this issue, as EventFlow doesn’t lose consistency.Possible solutions
Mitigation
Steps can be made to minimize the impact that an unexpected shutdown has