messaging: do not delete client during messaging service shutdown
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 #1059 Message-Id: <1458639452-29388-2-git-send-email-gleb@scylladb.com>
This commit is contained in:
Notes:
Avi Kivity
2016-03-26 22:06:40 +03:00
backport: 1.0
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user