Repository navigation
fix(streaming): recover cache misses from oldest data - #9711
ReubenBond merged 1 commit into
Conversation
|
Should fix #9332 |
9717779 to
7a7c2e2
Compare
There was a problem hiding this comment.
Pull request overview
This PR adjusts persistent stream consumption behavior to recover from queue cache misses by resuming from the oldest available cached token (when available), addressing scenarios where infrequent streams can otherwise skip newly arrived messages after a cache miss.
Changes:
- Extend
QueueCacheMissExceptionto carry the typed low/oldest token (when constructed with typed tokens) for recovery logic. - Update
PersistentStreamPullingAgentto resume using the exception’s low token after a cache miss instead of defaulting to a null token. - Add tests validating that cache-miss recovery resumes from the oldest available token when present and falls back to the default cursor behavior when not.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.Streaming.Tests/StreamingTests/PersistentStreamPullingAgentTests.cs | Adds coverage for cache-miss recovery behavior and validates cursor token selection. |
| src/Orleans.Streaming/QueueAdapters/QueueCacheMissException.cs | Adds an internal typed low-token hook to avoid relying on parsing string tokens for recovery. |
| src/Orleans.Streaming/PersistentStreams/PersistentStreamPullingAgent.cs | Uses the typed low token from QueueCacheMissException to resume consumption from the oldest available cached position. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
Code coverage
Report-only conclusion: regressed. The current-main baseline is commit 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 |
626237c to
6965da7
Compare
6965da7 to
f7f4e79
Compare
My goal is to fix issues with a stream that doesn't produce data very often. The problem is that the last sent value is no longer in the cache. However, the old value not being in the cache isn't really important. But when a new value comes for a stream that value is lost because when a QueueCacheMissException occurs and the cursor is set to start at the newest message and therefore skips the message that was just added, but is actually in the cache.
See https://github.com/BMagerMT/OrleansStreamingIssue as an example that produces this problem.
The issue is this fix is not great as it is parsing the token from the exception. However, there doesn't seem to be a way to create a cursor that starts with the oldest entries.
Microsoft Reviewers: Open in CodeFlow