Make it so when there is a cache miss exception the pulling agent can…#9714
Open
BMagerMT wants to merge 6 commits intodotnet:mainfrom
Open
Make it so when there is a cache miss exception the pulling agent can…#9714BMagerMT wants to merge 6 commits intodotnet:mainfrom
BMagerMT wants to merge 6 commits intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new OldestInStreamToken to handle cache miss scenarios by allowing the pulling agent to restart from the oldest available message in the cache, rather than passing null or attempting to extract a token from the exception.
Key Changes:
- Introduced
OldestInStreamTokenclass that represents the oldest position in a stream - Updated cache miss handling to use
OldestInStreamToken.Instanceinstead ofnull - Added cache logic to handle
OldestInStreamTokenby positioning cursors at the oldest message
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Orleans.Streaming/Core/OldestInStreamToken.cs | New token class representing the oldest position in a stream |
| src/Orleans.Streaming/PersistentStreams/PersistentStreamPullingAgent.cs | Updated cache miss exception handling to use OldestInStreamToken.Instance |
| src/Orleans.Streaming/Common/PooledCache/PooledQueueCache.cs | Added logic to position cursor at oldest message when OldestInStreamToken is provided |
| test/TesterInternal/OrleansRuntime/Streams/PooledQueueCacheTests.cs | Added test coverage for getting cursor at oldest entry |
test/TesterInternal/OrleansRuntime/Streams/PooledQueueCacheTests.cs
Outdated
Show resolved
Hide resolved
Member
|
@benjaminpetit PTAL |
Fix typo in test comment.
…n-at-oldest-message
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make it so when there is a cache miss exception the pulling agent can start with the oldest message. This is an alternate approach to getting the latest token from the exception as is done in #9711.
This also solves the issue demonstrated in https://github.com/BMagerMT/OrleansStreamingIssue
Microsoft Reviewers: Open in CodeFlow