Skip to content
Snippets Groups Projects
Commit 146a5c3f authored by Monty Brandenberg's avatar Monty Brandenberg
Browse files

Add 'internal'/'external' token to DEBUG retry message so that dev/QA

can know exactly where a retry value was sourced.
parent e764a2a5
No related branches found
No related tags found
No related merge requests found
...@@ -153,14 +153,16 @@ void HttpPolicy::retryOp(HttpOpRequest * op) ...@@ -153,14 +153,16 @@ void HttpPolicy::retryOp(HttpOpRequest * op)
}; };
static const int delta_max(int(LL_ARRAY_SIZE(retry_deltas)) - 1); static const int delta_max(int(LL_ARRAY_SIZE(retry_deltas)) - 1);
static const HttpStatus error_503(503); static const HttpStatus error_503(503);
const HttpTime now(totalTime()); const HttpTime now(totalTime());
const int policy_class(op->mReqPolicy); const int policy_class(op->mReqPolicy);
HttpTime delta(retry_deltas[llclamp(op->mPolicyRetries, 0, delta_max)]); HttpTime delta(retry_deltas[llclamp(op->mPolicyRetries, 0, delta_max)]);
bool external_delta(false);
if (op->mReplyRetryAfter > 0 && op->mReplyRetryAfter < 30) if (op->mReplyRetryAfter > 0 && op->mReplyRetryAfter < 30)
{ {
delta = op->mReplyRetryAfter * U64L(1000000); delta = op->mReplyRetryAfter * U64L(1000000);
external_delta = true;
} }
op->mPolicyRetryAt = now + delta; op->mPolicyRetryAt = now + delta;
++op->mPolicyRetries; ++op->mPolicyRetries;
...@@ -171,7 +173,8 @@ void HttpPolicy::retryOp(HttpOpRequest * op) ...@@ -171,7 +173,8 @@ void HttpPolicy::retryOp(HttpOpRequest * op)
LL_DEBUGS("CoreHttp") << "HTTP request " << static_cast<HttpHandle>(op) LL_DEBUGS("CoreHttp") << "HTTP request " << static_cast<HttpHandle>(op)
<< " retry " << op->mPolicyRetries << " retry " << op->mPolicyRetries
<< " scheduled in " << (delta / HttpTime(1000)) << " scheduled in " << (delta / HttpTime(1000))
<< " mS. Status: " << op->mStatus.toHex() << " mS (" << (external_delta ? "external" : "internal")
<< "). Status: " << op->mStatus.toHex()
<< LL_ENDL; << LL_ENDL;
if (op->mTracing > HTTP_TRACE_OFF) if (op->mTracing > HTTP_TRACE_OFF)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment