Skip to content

Commit

Permalink
chore: Expand logging in worker manager
Browse files Browse the repository at this point in the history
Bug: N/A
Change-Id: I6beb497e1666b0fcdb31afaf4f6e98089bd5c9d9
GitOrigin-RevId: 73a52687037a6688379faf107e392ee9135d0d64
  • Loading branch information
Privacy Sandbox Team authored and copybara-github committed Sep 12, 2024
1 parent 21791bc commit 571a6cc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/roma/byob/container/run_workers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int WorkerImpl(void* arg) {
}();
::execl(worker_impl_arg.binary_path.data(),
worker_impl_arg.binary_path.data(), connection_fd.c_str(), nullptr);
PLOG(FATAL) << "execl() failed";
PLOG(FATAL) << "exec '" << worker_impl_arg.binary_path << "' failed";
}
struct PidAndPivotRootDir {
int pid;
Expand Down Expand Up @@ -265,7 +265,13 @@ int main(int argc, char** argv) {
udf = std::move(it->second);
pid_to_udf.erase(it);
if (!WIFEXITED(status)) {
LOG(ERROR) << "Process pid=" << pid << " did not exit";
if (WIFSIGNALED(status)) {
LOG(ERROR) << "Process pid=" << pid
<< " terminated (signal=" << WTERMSIG(status)
<< ", coredump=" << WCOREDUMP(status) << ")";
} else {
LOG(ERROR) << "Process pid=" << pid << " did not exit";
}
} else if (const int exit_code = WEXITSTATUS(status); exit_code != 0) {
LOG(ERROR) << "Process pid=" << pid << " exit_code=" << exit_code;
}
Expand Down
10 changes: 8 additions & 2 deletions src/roma/byob/dispatcher/run_workers_without_sandbox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int WorkerImpl(void* arg) {
}();
::execl(worker_impl_arg.binary_path.data(),
worker_impl_arg.binary_path.data(), connection_fd.c_str(), nullptr);
PLOG(FATAL) << "execl() failed";
PLOG(FATAL) << "exec '" << worker_impl_arg.binary_path << "' failed";
}

// Returns `std::nullopt` when workers can no longer be created: in virtually
Expand Down Expand Up @@ -181,7 +181,13 @@ int main(int argc, char** argv) {
udf = std::move(it->second);
pid_to_udf.erase(it);
if (!WIFEXITED(status)) {
LOG(ERROR) << "Process pid=" << pid << " did not exit";
if (WIFSIGNALED(status)) {
LOG(ERROR) << "Process pid=" << pid
<< " terminated (signal=" << WTERMSIG(status)
<< ", coredump=" << WCOREDUMP(status) << ")";
} else {
LOG(ERROR) << "Process pid=" << pid << " did not exit";
}
} else if (const int exit_code = WEXITSTATUS(status); exit_code != 0) {
LOG(ERROR) << "Process pid=" << pid << " exit_code=" << exit_code;
}
Expand Down

0 comments on commit 571a6cc

Please sign in to comment.