1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

We don't need even a token timeout here; just poll once

The process is already gone, so there's not going to be any new data
showing up on its stderr; we only want to make sure that we haven't
missed something that was already written. So polling once is enough.
This commit is contained in:
Abhijit Menon-Sen 2015-09-24 19:57:49 +05:30 committed by James Cammarata
parent 6e82df451a
commit 82b33c381f

View file

@ -542,11 +542,13 @@ class Connection(ConnectionBase):
# When ssh has ControlMaster (+ControlPath/Persist) enabled, the
# first connection goes into the background and we never see EOF
# on stderr. If we see EOF on stdout and the process has exited,
# we're done. Just to be extra sure that we aren't missing any
# output on stderr, we call select again with a small timeout.
# we're probably done. We call select again with a zero timeout,
# just to make certain we don't miss anything that may have been
# written to stderr between the time we called select() and when
# we learned that the process had finished.
if not p.stdout in rpipes:
timeout = 0.001
timeout = 0
continue
# If the process has not yet exited, but we've already read EOF from