You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey folks! I've been using the watchmedo CLI to make a web server automatically restart when the contents of a directory change. Unfortunately we ran in to issues with this pretty quickly after launch because sending a SIGINT to watchmedo:
Cleans up the file observers
Sends a SIGINT to the child process
Step 1 takes about 500ms (at least on large directories like the one we're watching) and sending a second SIGINT in that time frame kills watchmedo without a SIGINT ever getting sent to the child.
If you're one of those keyboard bashing folks that hammers Ctrl-C, watchmedo basically never stops the child process when you kill it.
We've implemented a fix for this over here (dagster-io/dagster#930) that involves calling event_handler.stop() before cleaning up the file observers here: https://github.com/gorakhargosh/watchdog/blob/master/src/watchdog/watchmedo.py#L124. This might have undesirable side effects when observe_with is used in other modes (I'm not sure?) but it ensures that the child process is killed as soon as watchmedo receives a signal and it doesn't leave dangling processes.
Would a PR for this be mergeable?
The text was updated successfully, but these errors were encountered:
bengotow
changed the title
Sending repeated SIGINT (Ctrl-C) signals to watchmedo auto-restart does not stop the child process
Sending repeated SIGINT (Ctrl-C) signals to watchmedo auto-restart exits without stopping the child process
Mar 15, 2019
This fixes misbehaviour where the child process could be orphaned if
watchmedo received multiple non-fatal signals causing the
`handler.stop()` call to be interrupted or never occur. By raising a
semantic exception after neutering the relevant signals, we give
ourselves a better chance of killing the child.
Fixesgorakhargosh#543
maybe-sybr
added a commit
to maybe-sybr/watchdog
that referenced
this issue
Oct 21, 2020
This fixes misbehaviour where the child process could be orphaned if
watchmedo received multiple non-fatal signals causing the
`handler.stop()` call to be interrupted or never occur. By raising a
semantic exception after neutering the relevant signals, we give
ourselves a better chance of killing the child.
Fixesgorakhargosh#543
Hey folks! I've been using the watchmedo CLI to make a web server automatically restart when the contents of a directory change. Unfortunately we ran in to issues with this pretty quickly after launch because sending a SIGINT to
watchmedo
:Step 1 takes about 500ms (at least on large directories like the one we're watching) and sending a second SIGINT in that time frame kills watchmedo without a SIGINT ever getting sent to the child.
If you're one of those keyboard bashing folks that hammers Ctrl-C, watchmedo basically never stops the child process when you kill it.
We've implemented a fix for this over here (dagster-io/dagster#930) that involves calling
event_handler.stop()
before cleaning up the file observers here: https://github.com/gorakhargosh/watchdog/blob/master/src/watchdog/watchmedo.py#L124. This might have undesirable side effects whenobserve_with
is used in other modes (I'm not sure?) but it ensures that the child process is killed as soon as watchmedo receives a signal and it doesn't leave dangling processes.Would a PR for this be mergeable?
The text was updated successfully, but these errors were encountered: