Skip to content

fix(persistent-subscriptions): preserve parked message accounting - #457

Merged
yordis merged 1 commit into
masterfrom
yordis/fix-parker-write-state
Aug 10, 2026
Merged

fix(persistent-subscriptions): preserve parked message accounting#457
yordis merged 1 commit into
masterfrom
yordis/fix-parker-write-state

Conversation

@yordis

@yordis yordis commented Aug 10, 2026

Copy link
Copy Markdown
Member
  • Failed park writes must not erase the last confirmed parked event or make operator statistics report fewer parked messages than actually exist.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches persistent subscription parking state used for operator metrics and retry behavior; the change is small and guarded by a focused test, but incorrect accounting could mislead ops during partial write failures.

Overview
Park write failures no longer corrupt in-memory parked-message stats. WriteStateCompleted in PersistentSubscriptionMessageParker now updates _lastParkedEventNumber and _oldestParkedMessage only when the write returns OperationResult.Success, instead of doing so on every completion (including timeouts and other failures).

That keeps ParkedMessageCount and GetOldestParkedMessage aligned with what was actually committed to the parked stream when a later park attempt fails. A new test parks one message successfully, then simulates a failed second park (CommitTimeout) and asserts the failure is surfaced while count and oldest timestamp stay unchanged.

Reviewed by Cursor Bugbot for commit 93b85ff. Bugbot is set up for automated code reviews on this repo. Configure here.

@yordis
yordis merged commit 07bfe6b into master Aug 10, 2026
22 checks passed
@yordis
yordis deleted the yordis/fix-parker-write-state branch August 10, 2026 21:49
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.

1 participant