MCPcopy Create free account
hub / github.com/apache/mesos / waitEndpoint

Method waitEndpoint

src/csi/service_manager.cpp:567–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565
566
567Future<Nothing> ServiceManagerProcess::waitEndpoint(const string& endpoint)
568{
569 CHECK(strings::startsWith(endpoint, "unix://"));
570 const string endpointPath =
571 strings::remove(endpoint, "unix://", strings::PREFIX);
572
573 if (os::exists(endpointPath)) {
574 return Nothing();
575 }
576
577 // Wait for the endpoint socket to appear until the timeout expires.
578 Timeout timeout = Timeout::in(CSI_ENDPOINT_CREATION_TIMEOUT);
579
580 return process::loop(
581 [=]() -> Future<Nothing> {
582 if (timeout.expired()) {
583 return Failure("Timed out waiting for endpoint '" + endpoint + "'");
584 }
585
586 return process::after(Milliseconds(10));
587 },
588 [=](const Nothing&) -> ControlFlow<Nothing> {
589 if (os::exists(endpointPath)) {
590 return Break();
591 }
592
593 return Continue();
594 });
595}
596
597
598Future<Nothing> ServiceManagerProcess::probeEndpoint(const string& endpoint)

Callers

nothing calls this directly

Calls 11

startsWithFunction · 0.85
NothingClass · 0.85
loopFunction · 0.85
FailureClass · 0.85
MillisecondsClass · 0.85
removeFunction · 0.50
existsFunction · 0.50
afterFunction · 0.50
BreakFunction · 0.50
ContinueClass · 0.50
expiredMethod · 0.45

Tested by

no test coverage detected