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

ReplayStrategies.LazyTimeLimitedReplayAccumulator trims and accumulate #2725

Merged

Conversation

bryce-anderson
Copy link
Contributor

Motivation:

The lazy accumulator doesn't eagerly evict items so it can be prone to poor behaviors under certain patterns. One of those patterns is having a large queue limit with a short timeout and infrequent re-subscribes. In this case a producer can fill the queue to the brim despite many elements being expired.

Modifications:

Trim stale entries when accumulating.

Result:

This removes a pathological case and leaves the only remaining pathological case being one where we get a large burst of messages, none of which have expired, and then we have no more new elements or subscribers for long durations which can put unnecessary pressure on the GC.

Motivation:

The lazy accumulator doesn't eagerly evict items so it can be prone
to poor behaviors under certain patterns. One of those patterns is
having a large queue limit with a short timeout and infrequent
re-subscribes. In this case a producer can fill the queue to the brim
despite many elements being expired.

Modifications:

Trim stale entries when accumulating.

Result:

This removes a pathological case and leaves the only remaining
pathological case being one where we get a large burst of messages,
none of which have expired, and then we have no more new elements or
subscribers for long durations which can put unnecessary pressure on
the GC.
@bryce-anderson bryce-anderson merged commit c92941c into apple:main Oct 5, 2023
15 checks passed
@bryce-anderson bryce-anderson deleted the bl_anderson/ReplayTrimOnAccumulate branch October 5, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants