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 crash on shutdown #374

Merged
merged 1 commit into from
Oct 26, 2016
Merged

Fix crash on shutdown #374

merged 1 commit into from
Oct 26, 2016

Conversation

pR0Ps
Copy link
Contributor

@pR0Ps pR0Ps commented Sep 23, 2016

When the root directory being watched by inotify was deleted, watchdog
would crash with a KeyError when shutting down.

This commit stops watching the deleted directory for events once it's
been deleted, as well as adds a guard for the crash.

@DonyorM
Copy link
Contributor

DonyorM commented Oct 24, 2016

I see no assert or any sort of actual test in your test method. Forgive me if I'm missing something, but what are you expecting to find there?

@pR0Ps
Copy link
Contributor Author

pR0Ps commented Oct 25, 2016

Without the patch applied, inotify.close() causes a KeyError in the situation set up by the test. I'm open to suggestions on how to make the test more clear. A comment maybe? Or is the test just not needed?

@DonyorM
Copy link
Contributor

DonyorM commented Oct 26, 2016

Ahhh, I see. Yes, a quick comment would be helpful, in case someone is looking over this in the future. But leave the test, it's helpful in case someone makes an edit that causes the problem to come back.

When the root directory being watched by inotify was deleted, watchdog
would crash with a KeyError when shutting down.

This commit stops watching the deleted directory for events once it's
been deleted, as well as adds a guard for the crash.
@pR0Ps
Copy link
Contributor Author

pR0Ps commented Oct 26, 2016

@DonyorM: Added a comment

@DonyorM
Copy link
Contributor

DonyorM commented Oct 26, 2016

Thanks for helping out with this!

@DonyorM DonyorM merged commit 22c6055 into gorakhargosh:master Oct 26, 2016
CCP-Aporia pushed a commit to CCP-Aporia/watchdog that referenced this pull request Aug 13, 2020
Fix crash on shutdown when root directory deleted.
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.

None yet

2 participants