Revert Popen bufsize to Python 2.7 default value.
This might be the reason causing the process to not terminate. This CL adds also more logging. No-Presubmit: True Bug: webrtc:13607 Change-Id: I9fc2cf39d2c1df92670b45dd081022ce69068836 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250181 Reviewed-by: Jeremy Leconte <jleconte@google.com> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35885}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
1901551b00
commit
d5f98ce8cf
@ -177,14 +177,19 @@ def _RunPesq(executable_path,
|
|||||||
# Need to provide paths in the current directory due to a bug in PESQ:
|
# Need to provide paths in the current directory due to a bug in PESQ:
|
||||||
# On Mac, for some 'path/to/file.wav', if 'file.wav' is longer than
|
# On Mac, for some 'path/to/file.wav', if 'file.wav' is longer than
|
||||||
# 'path/to', PESQ crashes.
|
# 'path/to', PESQ crashes.
|
||||||
|
# The bufsize is set to 0 to keep the default Python 2.7 behaviour (it
|
||||||
|
# changed to -1 in Python >3.3.1 but this is causing issues).
|
||||||
process = subprocess.Popen(_LogCommand(command),
|
process = subprocess.Popen(_LogCommand(command),
|
||||||
|
bufsize=0,
|
||||||
cwd=directory,
|
cwd=directory,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
logging.info('Waiting for termination ...')
|
||||||
out, err = process.communicate(timeout=120)
|
out, err = process.communicate(timeout=120)
|
||||||
except TimeoutExpired:
|
except TimeoutExpired:
|
||||||
|
logging.error('Timeout, killing the process.')
|
||||||
process.kill()
|
process.kill()
|
||||||
out, err = process.communicate()
|
out, err = process.communicate()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user