Skip to content

Watch: an emitter that dies before the first liveness tick is never reported - #1064

Open
loonister1 wants to merge 3 commits into
tirth8205:stagingfrom
loonister1:fix/891-watch-an-emitter-that-dies-before-the-fi
Open

loonister1 wants to merge 3 commits into
tirth8205:stagingfrom
loonister1:fix/891-watch-an-emitter-that-dies-before-the-fi

Conversation

@loonister1

Copy link
Copy Markdown
Contributor

check_liveness now 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 inotify ENOSPC now reaches the existing reschedule-once-then-report path rather than leaving a directory unwatched behind a healthy crg-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.

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

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.

watch: an emitter that dies before the first liveness tick is never reported

1 participant