runOnFailedClients should be used cautiously. Some failed clients may not have successfully loaded all symbols.
| 2182 | |
| 2183 | // runOnFailedClients should be used cautiously. Some failed clients may not have successfully loaded all symbols. |
| 2184 | void 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 | |
| 2216 | Reference<ClientInfo> MultiVersionApi::getLocalClient() { |
| 2217 | return localClient; |
no test coverage detected