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

Method finished

src/log/recover.cpp:598–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596 }
597
598 void finished(const Future<bool>& future)
599 {
600 if (future.isDiscarded()) {
601 promise.discard();
602 terminate(self());
603 } else if (future.isFailed()) {
604 promise.fail(future.failure());
605 terminate(self());
606 } else if (!future.get()) {
607 // We add a random delay before each retry because we do not
608 // want to saturate the network/disk IO in some cases. The delay
609 // is chosen randomly to reduce the likelyhood of conflicts
610 // (i.e., a replica receives a recover request while it is
611 // changing its status).
612 static const Duration T = Milliseconds(500);
613 Duration d = T * (1.0 + (double) os::random() / RAND_MAX);
614 VLOG(2) << "Retrying recovery in " << stringify(d);
615 delay(d, self(), &Self::start);
616 } else {
617 promise.set(replica);
618 terminate(self());
619 }
620 }
621
622 const size_t quorum;
623 Owned<Replica> replica;

Callers

nothing calls this directly

Calls 12

MillisecondsClass · 0.85
randomFunction · 0.85
isDiscardedMethod · 0.80
isFailedMethod · 0.80
failureMethod · 0.80
terminateFunction · 0.50
stringifyFunction · 0.50
delayFunction · 0.50
discardMethod · 0.45
failMethod · 0.45
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected