Skip to content
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

When replaying a group of parked messages and the message is parked, the event is still retried #3696

Open
anthonyMc11 opened this issue Jan 6, 2023 · 2 comments
Labels
kind/bug Issues which are a software defect subsystem/persistent subs Issues relating to persistent subscriptions

Comments

@anthonyMc11
Copy link

anthonyMc11 commented Jan 6, 2023

Describe the bug
When you replay a group of parked message and N'ack to be parked, this is ignore and the event is retried

To Reproduce

  1. create a subscriber to a persistent subscription - timeout (10000ms)
  2. code the subscription to handle the event with a task.Delay until AFTER the timeout to park the message (20000ms)
  3. add an event to the stream
  4. the event will be retried
  5. both the original attempt and the retry now park the message
  6. the parked stream has 1 copy of the event
  7. click replay parked messages in the UI
  8. the the event is retried as it's not been n'acked yet
  9. the original and the retry n'ack the event
  10. the event is returned to the parked queue with a new event number as a single copy (success scenario and desired behaviour)
  11. add 4 more events
  12. the parked queue now has 5 events
  13. click replayed events in the UI
  14. continue to n'ack the message to park
  15. the events are retried the maximum numbers of retries ( failure scenario they ignore the n'ack to park)

Expected behaviour
groups of events are only retried until n'acked

Actual behaviour
The event is retried for the number of times the subscription is set to

Config/Logs/Screenshots
these are the logs for a single parked event, you can see it is parked, and then I replay the parked again and it is still replaying event 53
image
these are the logs for 5 events, as you can see the event 53 is now sent 11 times (3 times in this screen shot) without receiving a new parked event number

image

subscription set up
image

EventStore details

  • EventStore server version: 21.10.8.0

  • Operating system: Linux

  • EventStore client version (if applicable):
    5.0.9
    Additional context

code example below

 private async Task ProcessEvent(ResolvedEvent sourceEvent)
        {
            Log.Information($"Event received: {sourceEvent.Event.EventStreamId}:{sourceEvent.Event.EventNumber} Link.StreamId:{sourceEvent.Link?.EventStreamId}:{sourceEvent.Link?.EventNumber}");
            Log.Information("event received, start sleeping");
            await Task.Delay(20000);

            Log.Information("park handling");
             Log.Warning($"Error handling event:");
            Subscription?.Fail(resolvedEvent, PersistentSubscriptionNakEventAction.Skip,   "");
        }

@anthonyMc11 anthonyMc11 added the kind/bug Issues which are a software defect label Jan 6, 2023
@anthonyMc11 anthonyMc11 changed the title When replaying a group of parked message and the message is parked, the event is still retried When replaying a group of parked messages and the message is parked, the event is still retried Jan 6, 2023
@hayley-jean hayley-jean added the subsystem/persistent subs Issues relating to persistent subscriptions label Jan 9, 2023
@ylorph
Copy link
Contributor

ylorph commented Jan 23, 2023

possibility : the client side buffer that does not clear the buffer, so the client can get duplicates if the messages are processed too slowly.

@anthonyMc11
Copy link
Author

Thanks for your feed back ylorph, I thought so too, however the behaviour does not present itself when only a single event is being replayed, which would surely suffer the same issue with the client side buffer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues which are a software defect subsystem/persistent subs Issues relating to persistent subscriptions
Projects
None yet
Development

No branches or pull requests

3 participants