More verbose logging on graceful exit timeout

PiperOrigin-RevId: 554382651
Change-Id: I7205fed9285b2aaff93860782d65d3dc829bb5f9
This commit is contained in:
Wiktor Garbacz 2023-08-07 00:27:17 -07:00 committed by Copybara-Service
parent 0a0ac6a66b
commit dd664400d7
3 changed files with 6 additions and 1 deletions

View File

@ -456,6 +456,7 @@ cc_library(
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",

View File

@ -432,6 +432,7 @@ target_link_libraries(sandbox2_monitor_ptrace
PRIVATE absl::cleanup
absl::flat_hash_set
absl::flags
absl::log
absl::status
absl::strings
absl::time

View File

@ -35,6 +35,7 @@
#include "absl/container/flat_hash_set.h"
#include "absl/flags/declare.h"
#include "absl/flags/flag.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/time/time.h"
@ -419,7 +420,9 @@ void PtraceMonitor::Run() {
for (;;) {
auto left = deadline - absl::Now();
if (absl::Now() >= deadline) {
LOG(INFO) << "Waiting for sandboxee exit timed out";
LOG(WARNING)
<< "Waiting for sandboxee exit timed out. Sandboxee result: "
<< result_.ToString();
break;
}
pid_t ret = pid_waiter.Wait(&status);