-
Notifications
You must be signed in to change notification settings - Fork 27
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] Use process.run instead of process.Popen, to avoid deadlock #208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, great PR for fixing the issue, thanks 👍
I'd love to get the suggested changes implement to have a nicer output.
And I will further test around this PR a little. Furthermore, I'll have a look why I did it the way it was and if the change supports that "why".
I'm looking forward getting this merged if we both are OK with it :-)
I did some research because I had in mind that i used This is the PR which changed from Documentation is not tooo heavy at this point but if I remember right the reason was to get the output from the subprocess into Python and be able to log it. For when running in verbose mode or getting a error (in the subprocess). Before this PR, I was just issuing messages defined by me instead of what came from the subprocess. I like your way of doing it, looks cleaner and I think we get what we want from the subprocess. Have only checked for successful calls up to now, the PS: If you create maps for xy-coordingate |
When using process.Popen, and there is a large amount of data being returned on std out or error by the subprocess, it might cause a deadlock. So Popen is not recommended to use in these casses, we should rather use the run command.
see suggestions from code review
3e72b4a
to
1b23ab5
Compare
Hi @treee111, I'm also stuck on generating 133/75 tile. Could you make a new release? If you are busy I can help with the release |
Hi @lucky125111, thanks for the heads-up. installable via |
…ee111#208) * Use process.run instead of process.Popen, to avoid deadlock When using process.Popen, and there is a large amount of data being returned on std out or error by the subprocess, it might cause a deadlock. So Popen is not recommended to use in these casses, we should rather use the run command. * PR review adjustments see suggestions from code review --------- Co-authored-by: Benjamin K <[email protected]>
This PR…
Considerations and implementations
The current use of subprocess.Popen always causes a hang due to deadlock when generating the 133/75 tile, for example.
The hang is when running the osmosis command, which produces quite a bit of output for this tile.
See idential issue: https://stackoverflow.com/questions/39477003/python-subprocess-popen-hanging
How to test
Pull Request Checklist