Skip to content

Commit

Permalink
Merge pull request #9992 from Icinga/remove-redundat-cpu-bound-work
Browse files Browse the repository at this point in the history
Drop redundant `CpuBoundWork` usage in `JsonRpcConnection::Disconnect()`
  • Loading branch information
julianbrost committed Feb 13, 2024
2 parents fc6a106 + e2793f1 commit 2be08aa
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/remote/jsonrpcconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,14 @@ void JsonRpcConnection::Disconnect()
Log(LogWarning, "JsonRpcConnection")
<< "API client disconnected for identity '" << m_Identity << "'";

{
CpuBoundWork removeClient (yc);

if (m_Endpoint) {
m_Endpoint->RemoveClient(this);
} else {
ApiListener::GetInstance()->RemoveAnonymousClient(this);
}
// We need to unregister the endpoint client as soon as possible not to confuse Icinga 2,
// given that Endpoint::GetConnected() is just performing a check that the endpoint's client
// cache is not empty, which could result in an already disconnected endpoint never trying to
// reconnect again. See #7444.
if (m_Endpoint) {
m_Endpoint->RemoveClient(this);
} else {
ApiListener::GetInstance()->RemoveAnonymousClient(this);
}

m_OutgoingMessagesQueued.Set();
Expand Down

0 comments on commit 2be08aa

Please sign in to comment.