summaryrefslogtreecommitdiff
path: root/indra/llcorehttp/_httppolicy.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2017-07-26 17:12:43 +0000
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2017-07-26 17:12:43 +0000
commitfe57538d2f96f37cf7f7590e0d2bfd8b907f3e68 (patch)
tree847424ba546da34a6eba688614c6cfb2153e96cf /indra/llcorehttp/_httppolicy.cpp
parent822183057b13c8187d9dab68232b4274bc3ec3b2 (diff)
parent1a5fa01fb894d8e7da575d313fd5270fe4289ca7 (diff)
Merged MAINT-7495 Viewer retries too many times apon 504 from login.cgi
Approved-by: Simon Linden <simon@lindenlab.com> Approved-by: Andrey Lihatskiy <andreylproductengine@lindenlab.com> Approved-by: Oz Linden <oz@lindenlab.com> Approved-by: Maxim Nikolenko <maximnproductengine@lindenlab.com>
Diffstat (limited to 'indra/llcorehttp/_httppolicy.cpp')
-rw-r--r--indra/llcorehttp/_httppolicy.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp
index b2709b53ec..4889cac9bf 100644
--- a/indra/llcorehttp/_httppolicy.cpp
+++ b/indra/llcorehttp/_httppolicy.cpp
@@ -151,20 +151,16 @@ void HttpPolicy::addOp(const HttpOpRequest::ptr_t &op)
void HttpPolicy::retryOp(const HttpOpRequest::ptr_t &op)
{
- static const HttpTime retry_deltas[] =
- {
- 250000, // 1st retry in 0.25 S, etc...
- 500000,
- 1000000,
- 2000000,
- 5000000 // ... to every 5.0 S.
- };
- static const int delta_max(int(LL_ARRAY_SIZE(retry_deltas)) - 1);
static const HttpStatus error_503(503);
const HttpTime now(totalTime());
const int policy_class(op->mReqPolicy);
- HttpTime delta(retry_deltas[llclamp(op->mPolicyRetries, 0, delta_max)]);
+
+ HttpTime delta_min = op->mPolicyMinRetryBackoff;
+ HttpTime delta_max = op->mPolicyMaxRetryBackoff;
+ // mPolicyRetries limited to 100
+ U32 delta_factor = op->mPolicyRetries <= 10 ? 1 << op->mPolicyRetries : 1024;
+ HttpTime delta = llmin(delta_min * delta_factor, delta_max);
bool external_delta(false);
if (op->mReplyRetryAfter > 0 && op->mReplyRetryAfter < 30)