Skip to content

Make it so when there is a cache miss exception the pulling agent can…#9714

Open
BMagerMT wants to merge 6 commits intodotnet:mainfrom
BMagerMT:recover-from-exception-at-oldest-message
Open

Make it so when there is a cache miss exception the pulling agent can…#9714
BMagerMT wants to merge 6 commits intodotnet:mainfrom
BMagerMT:recover-from-exception-at-oldest-message

Conversation

@BMagerMT
Copy link
Copy Markdown
Contributor

@BMagerMT BMagerMT commented Oct 8, 2025

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 OldestInStreamToken class that represents the oldest position in a stream
  • Updated cache miss handling to use OldestInStreamToken.Instance instead of null
  • Added cache logic to handle OldestInStreamToken by 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

@ReubenBond
Copy link
Copy Markdown
Member

@benjaminpetit PTAL

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.

3 participants