@@ -852,11 +852,24 @@ void ApiListener::NewClientHandlerInternal(
852
852
JsonRpcConnection::Ptr aclient = new JsonRpcConnection (identity, verify_ok, client, role);
853
853
854
854
if (endpoint) {
855
- endpoint->AddClient (aclient);
855
+ static const auto reuniteCluster ([](const JsonRpcConnection::Ptr & aclient) {
856
+ auto endpoint (aclient->GetEndpoint ());
856
857
857
- Utility::QueueAsyncCallback ([this , aclient, endpoint]() {
858
- SyncClient (aclient, endpoint, true );
858
+ endpoint->AddClient (aclient);
859
+
860
+ Utility::QueueAsyncCallback ([this , aclient, endpoint] {
861
+ SyncClient (aclient, endpoint, true );
862
+ });
859
863
});
864
+
865
+ if (endpoint->GetZone () == Zone::GetLocalZone ()) {
866
+ // Nodes in the same zone, which do teamwork, must know each other's capabilities in advance.
867
+ // Hence, we delay everything else until they're told us via an icinga::Hello message.
868
+ // Even v2.12 nodes send this message at the beginning, so we're safe.
869
+ aclient->OnNextHello .connect (reuniteCluster);
870
+ } else {
871
+ reuniteCluster (aclient);
872
+ }
860
873
} else if (!AddAnonymousClient (aclient)) {
861
874
Log (LogNotice, " ApiListener" )
862
875
<< " Ignoring anonymous JSON-RPC connection " << conninfo
0 commit comments