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

vsc.utils.run.Command.run should poll() the process for its timeout #43

Open
piojo-zz opened this issue Dec 14, 2012 · 0 comments
Open

Comments

@piojo-zz
Copy link
Contributor

For timeouts, vsc.util.run.Command.run() checks for the existence of /proc/<pid> for validating the timeout.

This is unreliable: proc may not be mounted (under a chroot or with init=/bin/sh) or who knows what else.

The Pythonic way to check for process termination is to call poll():

p = Popen(["my", "command"])
while p.poll() is None:
   pass
p.terminate() # or p.kill()

Also, commands shouldn't run in subshells by default.

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

No branches or pull requests

1 participant