@@ -1204,6 +1204,20 @@ void ApiListener::SyncSendMessage(const Endpoint::Ptr& endpoint, const Dictionar
1204
1204
}
1205
1205
}
1206
1206
1207
+ /* *
1208
+ * Log the endpoint currently used to relay messages to our parent zone if it (the endpoint) has changed.
1209
+ *
1210
+ * @param zone The parent zone
1211
+ * @param endpoint The new endpoint
1212
+ */
1213
+ void ApiListener::LogCurrentParentEndpoint (const Zone::Ptr& zone, const Endpoint::Ptr& endpoint)
1214
+ {
1215
+ if (m_CurrentParentEndpoint.exchange (endpoint.get ()) != endpoint.get ()) {
1216
+ Log (LogInformation, " ApiListener" ) << " Relaying messages for parent Zone '"
1217
+ << zone->GetName () << " ' to Endpoint '" << endpoint->GetName () << " '" ;
1218
+ }
1219
+ }
1220
+
1207
1221
/* *
1208
1222
* Relay a message to a directly connected zone or to a global zone.
1209
1223
* If some other zone is passed as the target zone, it is not relayed.
@@ -1220,11 +1234,12 @@ bool ApiListener::RelayMessageOne(const Zone::Ptr& targetZone, const MessageOrig
1220
1234
ASSERT (targetZone);
1221
1235
1222
1236
Zone::Ptr localZone = Zone::GetLocalZone ();
1237
+ auto parentZone (localZone->GetParent ());
1223
1238
1224
1239
/* only relay the message to a) the same local zone, b) the parent zone and c) direct child zones. Exception is a global zone. */
1225
1240
if (!targetZone->GetGlobal () &&
1226
1241
targetZone != localZone &&
1227
- targetZone != localZone-> GetParent () &&
1242
+ targetZone != parentZone &&
1228
1243
targetZone->GetParent () != localZone) {
1229
1244
return true ;
1230
1245
}
@@ -1303,12 +1318,20 @@ bool ApiListener::RelayMessageOne(const Zone::Ptr& targetZone, const MessageOrig
1303
1318
bool isMaster = (currentZoneMaster == localEndpoint);
1304
1319
1305
1320
if (!isMaster && targetEndpoint != currentZoneMaster) {
1321
+ if (currentTargetZone == parentZone) {
1322
+ LogCurrentParentEndpoint (parentZone, currentZoneMaster);
1323
+ }
1324
+
1306
1325
skippedEndpoints.push_back (targetEndpoint);
1307
1326
continue ;
1308
1327
}
1309
1328
1310
1329
relayed = true ;
1311
1330
1331
+ if (currentTargetZone == parentZone) {
1332
+ LogCurrentParentEndpoint (parentZone, targetEndpoint);
1333
+ }
1334
+
1312
1335
SyncSendMessage (targetEndpoint, message);
1313
1336
}
1314
1337
0 commit comments