Commit 6a4ab3d6 authored by Lepton Wu's avatar Lepton Wu Committed by Commit Bot

Fix pending_broker_clients handling

We always remove invitee from pending_invitations_ before adding it to
pending_broker_clients, so the old code actually is buggy and invitees
in pending_broker_clients_ will never be added as a broker client. Fix
it by checking peers_ instead of pending_invitations_.

BUG=b:146518063,b:150661600,b:168250032,chromium:1121709
TEST=manual - Keep running arc.Boot.vm with updated mojo code.

Change-Id: Ib0353944e7d5b9edc04947f8bd2db1442a4ed78d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411560
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Auto-Submit: Lepton Wu <lepton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807076}
parent de774d83
......@@ -993,11 +993,8 @@ void NodeController::OnAcceptBrokerClient(const ports::NodeName& from_node,
// Feed the broker any pending invitees of our own.
while (!pending_broker_clients.empty()) {
const ports::NodeName& invitee_name = pending_broker_clients.front();
auto it = pending_invitations_.find(invitee_name);
// If for any reason we don't have a pending invitation for the invitee,
// there's nothing left to do: we've already swapped the relevant state into
// the stack.
if (it != pending_invitations_.end()) {
auto it = peers_.find(invitee_name);
if (it != peers_.end()) {
broker->AddBrokerClient(invitee_name,
it->second->CloneRemoteProcessHandle());
}
......
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