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

Method retry

src/zookeeper/group.cpp:923–953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

921
922
923void GroupProcess::retry(const Duration& duration)
924{
925 if (!retrying) {
926 // Retry could be cancelled before it is scheduled.
927 return;
928 }
929
930 // We cancel the retries when the group aborts and when its ZK
931 // session expires so 'retrying' should be false in the condition
932 // check above.
933 CHECK_NONE(error);
934
935 // In order to be retrying, we should be at least CONNECTED.
936 CHECK(state == CONNECTED || state == AUTHENTICATED || state == READY)
937 << state;
938
939 // Will reset it to true if another retry is necessary.
940 retrying = false;
941
942 Try<bool> synced = sync();
943
944 if (synced.isError()) {
945 // Non-retryable error. Abort.
946 abort(synced.error());
947 } else if (!synced.get()) {
948 // Backoff and keep retrying.
949 retrying = true;
950 Seconds seconds = std::min(duration * 2, Duration(Seconds(60)));
951 delay(seconds, self(), &GroupProcess::retry, seconds);
952 }
953}
954
955
956void GroupProcess::abort(const string& message)

Callers 1

requestMethod · 0.45

Calls 7

minFunction · 0.85
DurationClass · 0.85
SecondsClass · 0.85
errorMethod · 0.65
delayFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected