Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition in PollingDirectoryWatcher #71

Closed
wants to merge 2 commits into from
Closed

Conversation

grouma
Copy link
Member

@grouma grouma commented May 22, 2019

@grouma grouma requested a review from natebosch May 22, 2019 23:11
@natebosch
Copy link
Member

Do we want to change how this is handled at

modified = await getModificationTime(path);

@grouma
Copy link
Member Author

grouma commented May 22, 2019

I don't think we want to change the logic in the file_watcher. A user is explicitly providing a path to watch and therefore would like want to be notified of watch errors. The directory watcher is using implicit file paths due to the polling logic.

@natebosch
Copy link
Member

A user is explicitly providing a path to watch and therefore would like want to be notified of watch errors

I don't think it would be considered an error. We handle the removed case at

if (_lastModified != null && !pathExists) {
_eventsController.add(WatchEvent(ChangeType.REMOVE, path));
unawaited(close());
return;
}
- we just have a potential race condition for if the file is removed in between our check for exists and our file stat.

@grouma grouma closed this Jun 18, 2019
@kevmoo kevmoo deleted the race-condition branch March 7, 2023 15:39
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.

Race condition in PollingDirectoryWatcher
3 participants