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

Windows-only bug #34

Closed
pombredanne opened this issue Apr 5, 2013 · 2 comments
Closed

Windows-only bug #34

pombredanne opened this issue Apr 5, 2013 · 2 comments

Comments

@pombredanne
Copy link
Contributor

I did hit this bug today: http://bugs.python.org/issue14252
which is also documented here I think:
http://stackoverflow.com/questions/5573257/windowserror-error-5-access-is-denied-when-trying-to-kill-a-subprocess-pytho
I will come with a patch to support the same approach patched in the main Python 2.7 regardless of the Python version

@apmorton
Copy link

apmorton commented May 7, 2013

This issue is caused by https://github.com/nickstenning/honcho/blob/master/honcho/process.py#L141

from the python docs: On Windows kill() is an alias for terminate()

The terminate function in the ProcessManager class basically kills each process twice when running on windows.

I think what happens is essentially a race condition with the return code checking.

If I change the function to only issue SIGALRM if not ON_WINDOWS and do nothing otherwise, there are no exceptions and the code still works properly.

On a slightly unrelated note, this issue only occurs on some programs run for me. specifically the django runserver command. Which also happens to not output anything over stdout until I try and terminate it, and then it dumps everything at once, which could also be related, since that would cause the delay in termination and hence trigger the race.

I do not know if the same issue with runserver occurs on linux regarding the output not being sent immediately.

@nickstenning
Copy link
Owner

Closing in favour of tracking this issue in #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

No branches or pull requests

3 participants