Clean up clientFailures periodically

This commit is contained in:
Lukas Joswiak 2021-08-20 15:12:16 -07:00
parent d004703cc8
commit adc1025fa1
2 changed files with 12 additions and 3 deletions

View File

@ -204,7 +204,6 @@ class ConfigBroadcasterImpl {
wait(watcher);
TraceEvent(SevDebug, "ConfigBroadcastClientDied", self->id).detail("ClientID", clientUID);
self->clients.erase(clientUID);
// TODO: Erase clientUID from clientFailures at some point
return Void();
}
@ -225,6 +224,18 @@ class ConfigBroadcasterImpl {
return Void();
}
// Clean up clientFailures futures. The values in this map should only
// be used for testing, and cleaning them up here ensures tests still
// have enough time to read the future while making sure the map
// doesn't grow unbounded.
for (auto it = impl->clientFailures.begin(); it != impl->clientFailures.end();) {
if (it->second.isReady()) {
it = impl->clientFailures.erase(it);
} else {
++it;
}
}
TraceEvent(SevDebug, "ConfigBroadcasterRegisteringWorker", impl->id)
.detail("ClientID", broadcastInterface.id())
.detail("MostRecentVersion", impl->mostRecentVersion)

View File

@ -910,5 +910,3 @@ TEST_CASE("/fdbserver/ConfigDB/Transaction/BadRangeRead") {
}
return Void();
}
// TODO: Test worker failure detection on ConfigBroadcaster