Question on DeadlineManager cancel semantics

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):

  1. 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
  2. Saga tries to cancel the scheduled event, which fails because it’s no longer scheduled
  3. 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?


Thanks for the reply. Can you send me a doc link for this minimum interval? I think I agree with you though :slight_smile:

See “org.quartz.scheduler.idleWaitTime”.

Wow. I was about to post the same thing after googling. Thanks.