This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pmoravec
Recipients Dormouse759, martin.panter, pmoravec, vstinner
Date 2018-09-05.09:53:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1536141199.42.0.56676864532.issue34566@psf.upfronthosting.co.za>
In-reply-to
Content
> 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)
History
Date User Action Args
2018-09-05 09:53:19pmoravecsetrecipients: + pmoravec, vstinner, martin.panter, Dormouse759
2018-09-05 09:53:19pmoravecsetmessageid: <1536141199.42.0.56676864532.issue34566@psf.upfronthosting.co.za>
2018-09-05 09:53:19pmoraveclinkissue34566 messages
2018-09-05 09:53:19pmoraveccreate