Repository navigation
Watch: an emitter that dies before the first liveness tick is never reported - #1064
Open
loonister1 wants to merge 3 commits into
Open
loonister1 wants to merge 3 commits into
loonister1 wants to merge 3 commits into
Conversation
Liveness could only report a thread that a previous tick had recorded as alive, so an emitter that stopped between being scheduled and the first tick was never recorded and could never be reported. inotify watch exhaustion fails exactly there: the watcher kept running, health kept saying "alive", and that directory was never watched. A stopped thread with an ident has run, which separates the corpse from the emitter caught between construction and start without needing a tick to have seen it alive.
Pins the case the liveness check could not reach: a scheduled watch whose emitter stops before any tick sees it alive is noticed and rescheduled instead of leaving the directory unwatched behind a healthy status.
This branch has not been deployed
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.
check_livenessnow distinguishes a thread that never ran (ident is None, still not a corpse) from one that ran and stopped, instead of requiring a previous tick to have recorded it alive. That closes the hole where an emitter dying between scheduling and the first tick could never be recorded as live and therefore never as dead, so a registration-time failure such as inotifyENOSPCnow reaches the existing reschedule-once-then-report path rather than leaving a directory unwatched behind a healthycrg-daemon status.Fixes #891
Testing
[targeted; 3 commit(s) checked individually] $ /Users/m2/Documents/PW/github-bot/work/tirth8205__code-review-graph/891/.venv/bin/python -m pytest -q --no-header tests/test_incremental.py tests/test_watch_robustness.py
Notes for reviewers
Three things to check, in order.