mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
cluster: Fix deadlock when reconnecting.
This commit is contained in:
parent
7f52e04a01
commit
ecc583fba0
@ -164,13 +164,7 @@ void ClusterComponent::ListenerThreadProc(const Socket::Ptr& server)
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
Socket::Ptr client = server->Accept();
|
Socket::Ptr client = server->Accept();
|
||||||
|
|
||||||
try {
|
Utility::QueueAsyncCallback(bind(&ClusterComponent::NewClientHandler, this, client, TlsRoleServer));
|
||||||
NewClientHandler(client, TlsRoleServer);
|
|
||||||
} catch (const std::exception& ex) {
|
|
||||||
std::stringstream message;
|
|
||||||
message << "Error for new JSON-RPC socket: " << boost::diagnostic_information(ex);
|
|
||||||
Log(LogInformation, "cluster", message.str());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,12 +186,8 @@ void ClusterComponent::AddConnection(const String& node, const String& service)
|
|||||||
|
|
||||||
TcpSocket::Ptr client = boost::make_shared<TcpSocket>();
|
TcpSocket::Ptr client = boost::make_shared<TcpSocket>();
|
||||||
|
|
||||||
try {
|
client->Connect(node, service);
|
||||||
client->Connect(node, service);
|
Utility::QueueAsyncCallback(bind(&ClusterComponent::NewClientHandler, this, client, TlsRoleClient));
|
||||||
NewClientHandler(client, TlsRoleClient);
|
|
||||||
} catch (const std::exception& ex) {
|
|
||||||
Log(LogInformation, "cluster", "Could not connect to " + node + ":" + service + ": " + ex.what());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user