Commit ceddc919 authored by Ian Barkley-Yeung's avatar Ian Barkley-Yeung Committed by Commit Bot

Add VLOGs to diagnose missing broker processes.

We are still seeing lots of flakes on tast test
ChromeCrash[Not]LoggedIn.broker because it cannot find a broker
process to kill. My current hypothesis is that sometimes the broker
process's call to setproctitle() is failing. setproctitle() will
silently fail if something goes wrong, which is normally fine (it's just
to make `ps` output better) but which messes up the integration tests.

Add some VLOGs to confirm or deny. In particular, by logging the PID of
the broker process, I can compare to ps.txt and see if that process
exists with a different title.

Change
https://chromium-review.googlesource.com/c/chromiumos/platform/tast-tests/+/1888317
will activate the VLOGs during the tests.

BUG=chromium:984807
TEST=Ran tast -verbose run --extrauseflags chrome_internal my_crbook
ui.ChromeCrashLoggedIn.broker with change 1888317. Saw expected output
in logs.

Change-Id: I5ab77ff36194cd3fe7e2b7d69e7426738baae33b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1888870
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Auto-Submit: Ian Barkley-Yeung <iby@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711715}
parent 1c272ed6
...@@ -73,6 +73,7 @@ bool BrokerProcess::Init( ...@@ -73,6 +73,7 @@ bool BrokerProcess::Init(
return false; return false;
if (child_pid) { if (child_pid) {
VLOG(3) << "BrokerProcess::Init(), in parent, child is " << child_pid;
// We are the parent and we have just forked our broker process. // We are the parent and we have just forked our broker process.
ipc_reader.reset(); ipc_reader.reset();
broker_pid_ = child_pid; broker_pid_ = child_pid;
...@@ -85,6 +86,7 @@ bool BrokerProcess::Init( ...@@ -85,6 +86,7 @@ bool BrokerProcess::Init(
// We are the broker process. Make sure to close the writer's end so that // We are the broker process. Make sure to close the writer's end so that
// we get notified if the client disappears. // we get notified if the client disappears.
VLOG(3) << "BrokerProcess::Init(), in child";
ipc_writer.reset(); ipc_writer.reset();
CHECK(std::move(broker_process_init_callback).Run()); CHECK(std::move(broker_process_init_callback).Run());
BrokerHost broker_host(broker_permission_list_, allowed_command_set_, BrokerHost broker_host(broker_permission_list_, allowed_command_set_,
......
...@@ -115,6 +115,8 @@ bool UpdateProcessTypeAndEnableSandbox( ...@@ -115,6 +115,8 @@ bool UpdateProcessTypeAndEnableSandbox(
new_process_type = "broker"; new_process_type = "broker";
} }
VLOG(3) << "UpdateProcessTypeAndEnableSandbox: Updating process type to "
<< new_process_type;
command_line->AppendSwitchASCII(switches::kProcessType, new_process_type); command_line->AppendSwitchASCII(switches::kProcessType, new_process_type);
if (broker_side_hook) if (broker_side_hook)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment