msemys/esjc

CatchUpSubscription dropData not cleared on reconnect.

Closed this issue · 2 comments

Hi Mindaugas,

Consider the following scenario:

  1. EventStore server is started.
  2. Client application with catch-up subscription is started, with unlimited client reconnections and unlimited operation retries.
  3. Catch-up phase completes, live processing is started.
  4. EventStore server goes down.
  5. TCP connection drop is detected, volatile subscription is closed, catch-uo drop is enqueued (in response to volatile subscription calling onClose() on VolatileSubscriptionListener registered to it in CatchUpSubscription.runSubscription()). CatchUpSubscription.dropData is set (in enqueueSubscriptionDropNotification()).
  6. Drop event is processed in CatchUpSubscription.processLiveQueue(), dropData remains set.
  7. EventStore server goes up again.
  8. Client detects server restart and reconnects.
  9. CatchUpSubscription.reconnectionHook is invoked, restarting catch-up subscription.
  10. CatchUpSubscription.runSubscription() clears/resets stopped, allowProcessing and isDropped, but not dropData.
  11. Regular catch-up unsubscribe is no longer possible, since drop events will not get enqueued anymore.

The straightforward solution is to simply reset dropData in runSubscription() along with other markers. Of course, it is possible that we're missing something and that the solution should be more involved. We would be grateful for any feedback (or fix if possible).

Best regards,
Marko & Đorđe

You are right, dropData cleanup was missing. Thanks!

Thanks! Looking forward to next release.