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

Terminate all subprocesses #225

Merged
merged 1 commit into from Mar 23, 2014

Conversation

berdario
Copy link
Contributor

auto-restart won't terminate all children processes

 1e39bb6da6cffe8b  dario@macbook /tmp> cat file.py
from subprocess import call
call('python3 -m http.server'.split())
1e39bb6da6cffe8b  dario@macbook /tmp> 
watchmedo auto-restart -p /tmp/file.py python file.py
Serving HTTP on 0.0.0.0 port 8000 ...
on_any_event(self=<watchdog.tricks.AutoRestartTrick object at 0x2c7f450>, event=<FileModifiedEvent: src_path=/tmp/file.py>)
Traceback (most recent call last):
[SNIP]
OSError: [Errno 98] Address already in use

(I stumbled upon this problem with a Warp server run through the runhaskell program, that spawns a runghc and a ghc process, the dummy file.py is only for your ease to reproduce it)

I'm not storing the result of os.getpgid(self.process.pid) because it could change during the execution

thus handling all its children in the same group
(setsid is needed to get the process into a different group than watchdog)
tamland added a commit that referenced this pull request Mar 23, 2014
@tamland tamland merged commit 3a0f0ec into gorakhargosh:master Mar 23, 2014
CCP-Aporia pushed a commit to CCP-Aporia/watchdog that referenced this pull request Aug 13, 2020
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