fix(project): Cancel pending settle timer before watcher recovery - #1528
Open
matz3 wants to merge 1 commit into
Open
fix(project): Cancel pending settle timer before watcher recovery#1528matz3 wants to merge 1 commit into
matz3 wants to merge 1 commit into
Conversation
matz3
enabled auto-merge (rebase)
August 18, 2026 10:00
d3xter666
reviewed
Aug 18, 2026
Comment on lines
+233
to
+236
| // Cancel any pending settle timer before tearing down the subscriptions. On Windows, | ||
| // ReadDirectoryChangesW holds a raw HANDLE; a timer callback firing into a closed handle | ||
| // after recovery causes an access violation (0xC0000005). The timer is re-armed naturally | ||
| // by the first event that arrives on the new subscriptions. |
Member
There was a problem hiding this comment.
Do we need all the resoning here. I think there's much detail that needs a deeper look to understand the root cause.
From my perspective, it's completely resonable and expected to clear timeouts before releasing the property. Otherwise, side effects (like the one above) can be expected
Member
Author
There was a problem hiding this comment.
Yeah, thats right. Thanks for pointing that out. I removed it and refactored the code.
On Windows, a settle timer callback firing into a closed ReadDirectoryChangesW handle after recovery causes an access violation (0xC0000005). Cancel any pending timer before tearing down the subscriptions; it is re-armed by the first event on the new set. Extract the timer-cancel and subscription-drain logic shared by #recoverWatcher and destroy into #cancelSettleTimer and #drainSubscriptions helpers to remove the duplication.
matz3
force-pushed
the
fix/project-watcher-cancel-settle-timer
branch
from
August 18, 2026 12:35
fe7fc7e to
9744c52
Compare
Member
Author
|
The CI ran into a timeout on Windows, so this PR is most likely not solving all the current issues of flaky tests. I will continue investigating tomorrow. |
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.
On Windows, a settle timer callback firing into a closed ReadDirectoryChangesW handle after recovery causes an access violation (0xC0000005). Cancel any pending timer before tearing down the subscriptions; it is re-armed by the first event on the new set.
Extract the timer-cancel and subscription-drain logic shared by #recoverWatcher and destroy into #cancelSettleTimer and #drainSubscriptions helpers to remove the duplication.
This should resolve the flaky test observed via #1524 (comment).