Message324620
> The "poll" method does not wait for the child to exit. Normally you use the "wait" method in this situation. I suspect this is a bug in the application, not in Python.
Thanks for clarification. Could you please confirm what code change in that script is safe, then?
1) looping "while p.poll() == None pass" to really ensure some status is returned.
2) calling p.wait() before p.poll()
From a blackbox perspective, I would expect either to provide similar fixing mechanism of my script. But as we call this code snippet concurrently, for random commands that randomly terminates with random outcome / status, can't either fix attempt cause e.g. a deadlock?
Thanks in advance for help / advice.
(just for context if it matters: the snippet is from https://github.com/sosreport/sos/blob/master/sos/utilities.py#L158 where the sos_get_command_output method is called concurrently by more threads) |
|
Date |
User |
Action |
Args |
2018-09-05 09:53:19 | pmoravec | set | recipients:
+ pmoravec, vstinner, martin.panter, Dormouse759 |
2018-09-05 09:53:19 | pmoravec | set | messageid: <1536141199.42.0.56676864532.issue34566@psf.upfronthosting.co.za> |
2018-09-05 09:53:19 | pmoravec | link | issue34566 messages |
2018-09-05 09:53:19 | pmoravec | create | |
|