MCPcopy Create free account
hub / github.com/catboost/catboost / PingerThreadFunction

Method PingerThreadFunction

library/cpp/par/par_network.cpp:216–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214 }
215
216 void PingerThreadFunction() {
217 while (Running) {
218 THashSet<TNetworkAddress> requestedHosts;
219 auto collectHosts = [&requestedHosts](const TGUID&, TNetworkAddress& addr) {
220 requestedHosts.insert(addr);
221 };
222 RequestsInfo.LockedIterateValues(collectHosts);
223 if (requestedHosts) {
224 TGUID pingGuid;
225 CreateGuid(&pingGuid);
226 PAR_DEBUG_LOG << "From " << GetHostAndPort() << "Pinging " << requestedHosts.size() << " hosts" << Endl;
227 for (const auto& addr : requestedHosts) {
228 InternalSendQuery(addr, pingGuid, "_ping_", nullptr);
229 }
230 }
231 Sleep(TDuration::Seconds(2));
232 }
233 }
234
235 ~TNehRequester() override {
236 Running = false;

Callers

nothing calls this directly

Calls 7

CreateGuidFunction · 0.85
GetHostAndPortFunction · 0.85
SleepFunction · 0.85
LockedIterateValuesMethod · 0.80
SecondsFunction · 0.50
insertMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected