Since our app was written under Axon 2 when the DeadlineManager didn’t exist, we use scheduled events for all our deadlines. Occasionally we run into a race condition (“2a” and “2b” happen simultaneously):
- Saga schedules an event to mark a deadline
2a. Saga handles another event that makes the deadline irrelevant
2b. The scheduled event’s time arrives and it gets published - Saga tries to cancel the scheduled event, which fails because it’s no longer scheduled
- Scheduled event gets delivered to the saga, which is no longer expecting it
We end up needing to keep track of extra state so we know whether to process the scheduled event or ignore it.
Does DeadlineManager have the same race condition?