Coalesce reload cleanup workers by retained watch ownership - #200
Merged
Merged
Conversation
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.
Reloads could create another cleanup waiter for the same stale watch while its native close remained blocked. Reconciliation now admits each retained watch group once, coalesces repeated reloads and releases only worker admission after a completed wait. Failed native cleanup remains owned and a later reload can retry. Reloads with no new cleanup work start no worker.
The public Start/Reload regression counts this worker class through 32 reloads, verifies independent work and one native close, then checks retained failure and successful retry. It reproduces two waiters for one watch on the preceding implementation. A timer fixture also joins callback completion before comparing cached next-deadline observations.
Validation: twenty focused watch race repetitions passed. The full uncached suite passed every package except the timer fixture's observation race; after its correction, 100 repetitions and the complete timer suite passed. Vet, Windows/Linux staticcheck and documentation checks passed. Three combined watch/timer/idle/capture repetitions passed after integration. Final source
452afd26427e0dd9a22b658aabe86c87ffb96de7passed CI 34765143769. Eight delayed-adapter/ownership cases passed ten repetitions each under SYSTEM and a headless standard user (2.100/0.827 seconds), without skips and with full process/profile cleanup. R2 acceptance remains open.