Revert "Increase log information when a RootHelperProcess fails"

This reverts commit b1811dc1bb.

This backported patch introduced two incompatible calls in python2.7:
- subprocess.communicate does not have timeout as input parameter
- subprocess does not implement TimeoutExpired

Reason for revert: #1933366

Change-Id: I22f3bf543948dcadaf7276762b14198028f40bc6
This commit is contained in:
Rodolfo Alonso 2021-06-23 16:32:38 +00:00
parent f2a3410c82
commit 05d9250254
1 changed files with 5 additions and 19 deletions

View File

@ -327,25 +327,11 @@ class RootHelperProcess(subprocess.Popen):
if utils.pid_invoked_with_cmdline(child_pid, self.cmd):
return True
try:
common_utils.wait_until_true(child_is_running, timeout)
except common_utils.WaitTimeout:
# If there is an error, the stderr and stdout pipes usually have
# information returned by the command executed. If not, timeout
# the pipe communication quickly.
stdout = stderr = ''
try:
stdout, stderr = self.communicate(timeout=0.5)
except subprocess.TimeoutExpired:
pass
msg = ("Process %(cmd)s hasn't been spawned in %(seconds)d "
"seconds. Return code: %(ret_code)s, stdout: %(stdout)s, "
"stderr: %(stderr)s" %
{'cmd': self.cmd, 'seconds': timeout,
'ret_code': self.returncode, 'stdout': stdout,
'stderr': stderr})
raise RuntimeError(msg)
common_utils.wait_until_true(
child_is_running,
timeout,
exception=RuntimeError("Process %s hasn't been spawned "
"in %d seconds" % (self.cmd, timeout)))
self.child_pid = utils.get_root_helper_child_pid(
self.pid, self.cmd, run_as_root=True)