Skip to content

fix: Commit everything held at a track or identify at immediate persistence - #419

Open
abelonogov-ld wants to merge 1 commit into
andrey/event-durability-tier3-persistencefrom
andrey/immediate-track-commits-held-events
Open

abelonogov-ld wants to merge 1 commit into
andrey/event-durability-tier3-persistencefrom
andrey/immediate-track-commits-held-events

Conversation

@abelonogov-ld

Copy link
Copy Markdown
Contributor

Summary

At IMMEDIATE, track and identify wrote only their own event before returning and left the evaluations held before them, and their summaries, to a commit queued on the commit executor. A kill straight after the track (the test app's "Eval+Kill now") could therefore lose the exposure on slower devices, where the kill wins the race against the commit executor.

This goes back to committing everything held, under the commit lock, before the call returns. With oversized summaries no longer split (#408, 577261bb), that costs the caller a normal encode of the held run and the summaries.

Reverts 19afcecb and 12000256 from #408.

Trade-off

A track on the main thread waits for any commit already in progress, including a delivery's commit and close; usually well under a millisecond.

Tests

  • New anImmediateTrackPutsTheEvaluationsBeforeItOnDiskBeforeItReturns: holds the commit executor and expects the feature, summary and custom events on disk when track returns.
  • Full unit suite run 10 times: 1251 tests, 0 failures each run.

Made with Cursor

…e again

Writing only the tracked event left the evaluations before it to a commit
queued on the commit executor, so a kill straight after the track, which is
what immediate persistence is for, could take those exposures with it. With the
summary split gone, the commit costs the caller a normal encode of the held run
and the summaries, so the track commits it again before returning.

This reverts 19afcec and 1200025.

Co-authored-by: Cursor <cursoragent@cursor.com>
@abelonogov-ld
abelonogov-ld marked this pull request as ready for review November 3, 2026 17:36
@abelonogov-ld
abelonogov-ld requested a review from a team as a code owner November 3, 2026 17:36
@abelonogov-ld abelonogov-ld changed the title Commit everything held at a track or identify at immediate persistence fix: Commit everything held at a track or identify at immediate persistence Nov 3, 2026

This branch has not been deployed

No deployments
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