MCPcopy Create free account
hub / github.com/apple/foundationdb / runOnExternalClients

Method runOnExternalClients

fdbclient/MultiVersionTransaction.actor.cpp:2184–2214  ·  view source on GitHub ↗

runOnFailedClients should be used cautiously. Some failed clients may not have successfully loaded all symbols.

Source from the content-addressed store, hash-verified

2182
2183// runOnFailedClients should be used cautiously. Some failed clients may not have successfully loaded all symbols.
2184void MultiVersionApi::runOnExternalClients(int threadIdx,
2185 std::function<void(Reference<ClientInfo>)> func,
2186 bool runOnFailedClients) {
2187 bool newFailure = false;
2188
2189 auto c = externalClients.begin();
2190 while (c != externalClients.end()) {
2191 auto client = c->second[threadIdx];
2192 try {
2193 if (!client->failed || runOnFailedClients) { // TODO: Should we ignore some failures?
2194 func(client);
2195 }
2196 } catch (Error& e) {
2197 if (e.code() == error_code_external_client_already_loaded) {
2198 TraceEvent(SevInfo, "ExternalClientAlreadyLoaded").error(e).detail("LibPath", c->first);
2199 c = externalClients.erase(c);
2200 continue;
2201 } else {
2202 TraceEvent(SevWarnAlways, "ExternalClientFailure").error(e).detail("LibPath", c->first);
2203 client->failed = true;
2204 newFailure = true;
2205 }
2206 }
2207
2208 ++c;
2209 }
2210
2211 if (newFailure) {
2212 updateSupportedVersions();
2213 }
2214}
2215
2216Reference<ClientInfo> MultiVersionApi::getLocalClient() {
2217 return localClient;

Callers 1

MultiVersionDatabaseMethod · 0.80

Calls 7

TraceEventClass · 0.85
detailMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
codeMethod · 0.45
errorMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected