diff options
author | 2022-07-08 11:24:34 +0100 | |
---|---|---|
committer | 2022-07-08 14:24:32 +0000 | |
commit | 501af5a844821ef2ad3f89906893640c18ba848c (patch) | |
tree | 882b3e60b3bb62821d1d3d5f28dd8fb30deb92eb | |
parent | 2f47fec948441d9f25fad71e878a21ea25fb5d9e (diff) |
installd: Wait indefinitely for the subprocess if pidfd_open fails.
In Android T we introduced a feature in installd, which is to kill the
subprocess that times out. This feature is implemented by a syscall
pidfd_open, which requires kernel 5.4 or above, so it fails on older
kernels, and therefore causes installd unable to invoke dex2oat, etc.,
making the device unable to do any app compilation.
After this change, if pidfd_open fails, installd will wait indefinitely
for the subprocess, which is the behavior in Android S.
Bug: 238316970
Test: Presubmit
Change-Id: I12e492937b876b5b312b3f8eedce6e5d5d2a4a4e
-rw-r--r-- | cmds/installd/utils.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds/installd/utils.cpp b/cmds/installd/utils.cpp index c7bea3f4a9..65b25a495b 100644 --- a/cmds/installd/utils.cpp +++ b/cmds/installd/utils.cpp @@ -1182,8 +1182,8 @@ static int wait_child(pid_t pid) { int wait_child_with_timeout(pid_t pid, int timeout_ms) { int pidfd = pidfd_open(pid, /*flags=*/0); if (pidfd < 0) { - PLOG(ERROR) << "pidfd_open failed for pid " << pid; - kill(pid, SIGKILL); + PLOG(ERROR) << "pidfd_open failed for pid " << pid + << ", waiting for child process without timeout"; return wait_child(pid); } |