Skip to content

Commit

Permalink
messaging: do not delete client during messaging service shutdown
Browse files Browse the repository at this point in the history
Messaging service stop() method calls stop() on all clients. If
remove_rpc_client_one() is called while those stops are running
client::stop() will be called twice which not suppose to happen. Fix it
by ignoring client remove request during messaging service shutdown.

Fixes scylladb#1059

Message-Id: <1458639452-29388-2-git-send-email-gleb@scylladb.com>
  • Loading branch information
Gleb Natapov authored and avikivity committed Mar 22, 2016
1 parent b8abd88 commit 357c91a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions message/messaging_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,13 @@ shared_ptr<messaging_service::rpc_protocol_client_wrapper> messaging_service::ge
}

void messaging_service::remove_rpc_client_one(clients_map& clients, msg_addr id, bool dead_only) {
if (_stopping) {
// if messaging service is in a processed of been stopped no need to
// stop and remove connection here since they are being stopped already
// and we'll just interfere
return;
}

auto it = clients.find(id);
if (it != clients.end() && (!dead_only || it->second.rpc_client->error())) {
auto client = std::move(it->second.rpc_client);
Expand Down

0 comments on commit 357c91a

Please sign in to comment.