Repository navigation
refactor(streaming): add typed cache cursor results - #9714
Conversation
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 |
|
@benjaminpetit PTAL |
6711e20 to
dbf8374
Compare
dbf8374 to
f97071a
Compare
257519e to
cad42be
Compare
Code coverage
Report-only conclusion: current-main baseline stale. The newest successful coverage run tested b64c6d7, not current main d0582bd. Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities. The comparison remains report-only while normal line and branch variance is calibrated. Coverage details |
cad42be to
1f12040
Compare
5866dbb to
c375322
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The behavioral change is targeted, has a safe fallback path for unsupported caches, and includes focused regression tests covering the new scenarios.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
c375322 to
751f9f3
Compare
|
Current CI cannot compile |
f1d00ee to
85a9b6b
Compare
There was a problem hiding this comment.
🟡 Changes recommended
It introduces source/binary-breaking public API removals (GetCursorAtPosition) which should be preserved via [Obsolete] wrappers to maintain provider compatibility.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 23/23 changed files
- Comments generated: 2
- Review effort level: Lite
85a9b6b to
49f16d8
Compare
a73f6c6 to
e1da931
Compare
816db2c to
505e335
Compare
Queue cache cursor acquisition and advancement currently use
QueueCacheMissExceptionfor expected cursor states. This change introduces typed results so normal cache misses, empty/end states, and unsupported positioning can be handled without exception control flow.This follows #9711, which owns the message-loss recovery behavior. The duplicate recovery implementation from the original version of this PR has been removed. Delivery cache misses continue inclusively from
EarliestAvailable, while unsupported custom caches continue through their established token-based recovery path.The change:
PersistentStreamPullingAgentto typed results for expected cache statesQueueCacheMissException, andNotSupportedExceptionbehaviorThe branch history is consolidated into implementation/API and test commits.