fix(filetail): preserve reconciled checkpoint on first open - #157
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a file-tail “first open” race where reconcile() persisted a start-at-end checkpoint, but the spawned tail task could discard that reconciled snapshot and reload registry state before its first open—potentially ingesting pre-existing lines under coverage load.
Changes:
- Pass the checkpointed
FileTailSourcesnapshot produced byreconcile()into the spawned task, and use it for the first open when the live registry definition still matches. - Preserve existing disable/reconfigure behavior by validating the live registry entry first and continuing to reload registry state on retries.
- Add a deterministic
current_threadregression test that reproduces the original timing hazard reliably.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/filetail/supervisor.rs |
Ensures the first open uses the reconciled checkpoint snapshot (when the live definition matches), preventing pre-checkpoint ingestion. |
src/filetail/supervisor_tests.rs |
Adds a deterministic regression test that validates the first open honors the checkpoint snapshot created by reconcile(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jmagar
force-pushed
the
fix/filetail-checkpoint-sync
branch
from
August 2, 2026 04:16
e8cccd2 to
072d73a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Post-merge Coverage for #154 exposed a file-tail first-open race.
reconcile()persisted a start-at-end checkpoint, but the spawned task discarded the reconciled source snapshot and reloaded the registry before its first open. Under coverage load, the task could ingest a pre-existing line instead of starting from the checkpoint.Failed main run:
30722500743(Coverage).Fix
reconcile()into the taskVerification
cargo check --all-targets: passedcargo clippy --all-targets --all-features -- -D warnings: passed