Conversation
`persistPeriodicallyAndUnloadOrphaned` removed a key whenever the unload threshold was crossed, whether or not the persist that preceded it went through. With `ignorePersistErrors` on, a failed persist is logged and the key is unloaded anyway; `KeyContext.remove` also drops the offset it held, so the partition can commit past state that never reached the store and the next recovery skips those events. Gate the unload on the persist outcome: an unpersisted key stays loaded and keeps holding its offset until a later tick persists it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe timer flow now persists state before unloading orphaned keys. Ignored persistence failures keep keys in memory and retain their last held offsets. A regression test covers this behavior. ChangesTimer persistence and unloading
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Orphaned keys are now retained when persistence fails under ignored-error handling, preventing their offsets from being dropped before state is stored. The intended behavior is covered by regression testing, with no current merge-blocking risk identified. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
persistPeriodicallyAndUnloadOrphanedunloads a key whenever the unload threshold is crossed, even when the persist right before it failed andignorePersistErrorsswallowed the error.KeyContext.removealso drops the offset the key held, so the partition can commit past state that never reached the store, and the next recovery skips those events.The unload is now gated on the persist outcome:
attemptToPersistreturns whether the state was persisted. An unpersisted key stays loaded and keeps holding its offset until a later tick persists it. WithignorePersistErrors = trueand a store that keeps failing, keys therefore accumulate instead of being unloaded.Summary by CodeRabbit
Bug Fixes
Tests
The defect is described under "The existing escape and its cost" in #938; that issue is about the fence, and this fix stands on its own.