Skip to content

watch_applied_owned: hand the store back so a watch can resume in-process (v0.8.5) - #32

Merged
jaredLunde merged 1 commit into
mainfrom
jared/watch-resume-in-process
Oct 20, 2026
Merged

jaredLunde merged 1 commit into
mainfrom
jared/watch-resume-in-process

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

watch_applied closes its store on every exit, so a caller whose readers hold the store (instd's assignment fold keeps a FjallReader on it) can't re-open the path and has to restart the whole process on any watch error. A NATS heartbeat miss made instd do exactly that twice on 2026-10-20 (06:16 and 10:59 UTC).

  • New watch_applied_owned: the same loop without the close. Its WatchEnd carries the result, the applied cursor committed with the store's data, and the store itself, intact on every exit. The caller resumes by calling again with the same store and resume = applied. None means the store was lost (a flush task panicked).
  • watch_applied is now watch_applied_owned followed by the off-runtime close, so existing callers are unchanged.
  • Test: owned_watch_hands_the_store_back_and_resumes_in_process. A watch that dies on "missed idle heartbeat" returns its store intact; a second run folds the put and delete from the gap.
  • Full suite passes (133 lib tests plus the integration binaries); clippy is clean with -D warnings.
  • Release 0.8.5 (merging publishes to crates.io).

🤖 Generated with Claude Code

https://claude.ai/code/session_01XoaQgogNq1z3dNoM9feGoH

…cess

watch_applied closes its store on every exit, so a caller whose readers
hold the store (a fold's FjallReader keeps its database alive) cannot
re-open the path and has to restart the process on any watch error. A
NATS heartbeat miss made instd do exactly that, three times in one day.

watch_applied_owned is the same loop without the close. Its WatchEnd
carries the result, the applied cursor committed with the store's data,
and the store itself, intact on every exit, so the caller resumes by
calling again with the same store and resume = applied. watch_applied
is now watch_applied_owned followed by the off-runtime close. Release
0.8.5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XoaQgogNq1z3dNoM9feGoH
@jaredLunde
jaredLunde merged commit 6c4827f into main Oct 20, 2026
1 check passed
@jaredLunde
jaredLunde deleted the jared/watch-resume-in-process branch October 20, 2026 22:28
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