From 1a5fa01fb894d8e7da575d313fd5270fe4289ca7 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 24 Jul 2017 17:06:12 +0300 Subject: MAINT-7495 Viewer retries too many time apon 504 from login.cgi --- indra/newview/app_settings/settings.xml | 4 ++-- indra/newview/lllogininstance.cpp | 11 ++++++++--- indra/newview/llxmlrpclistener.cpp | 2 +- indra/newview/llxmlrpctransaction.cpp | 26 +++++++++++++++++--------- indra/newview/llxmlrpctransaction.h | 2 +- 5 files changed, 29 insertions(+), 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0303581d62..4154c96378 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5592,12 +5592,12 @@ Type F32 Value - 10.0 + 40.0 LoginSRVPump Comment - Name of the message pump that handles SRV request + Name of the message pump that handles SRV request (deprecated) Persist 0 Type diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index b4d0bb6823..40e98947a3 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -63,6 +63,8 @@ #include #include +const S32 LOGIN_MAX_RETRIES = 3; + class LLLoginInstance::Disposable { public: virtual ~Disposable() {} @@ -610,13 +612,16 @@ void LLLoginInstance::constructAuthParams(LLPointer user_credentia request_params["host_id"] = gSavedSettings.getString("HostID"); request_params["extended_errors"] = true; // request message_id and message_args + // Specify desired timeout/retry options + LLSD http_params; + http_params["timeout"] = gSavedSettings.getF32("LoginSRVTimeout"); + http_params["retries"] = LOGIN_MAX_RETRIES; + mRequestData.clear(); mRequestData["method"] = "login_to_simulator"; mRequestData["params"] = request_params; mRequestData["options"] = requested_options; - - mRequestData["cfg_srv_timeout"] = gSavedSettings.getF32("LoginSRVTimeout"); - mRequestData["cfg_srv_pump"] = gSavedSettings.getString("LoginSRVPump"); + mRequestData["http_params"] = http_params; } bool LLLoginInstance::handleLoginEvent(const LLSD& event) diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index cc3645131d..99070d5bee 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -312,7 +312,7 @@ public: } XMLRPC_RequestSetData(request, xparams); - mTransaction.reset(new LLXMLRPCTransaction(mUri, request)); + mTransaction.reset(new LLXMLRPCTransaction(mUri, request, true, command.has("http_params")? LLSD(command["http_params"]) : LLSD())); mPreviousStatus = mTransaction->status(NULL); // Free the XMLRPC_REQUEST object and the attached data values. diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index f8b38669b6..0c8495a6e4 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -208,7 +208,7 @@ public: std::string mCertStore; LLPointer mErrorCert; - Impl(const std::string& uri, XMLRPC_REQUEST request, bool useGzip); + Impl(const std::string& uri, XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams); Impl(const std::string& uri, const std::string& method, LLXMLRPCValue params, bool useGzip); ~Impl(); @@ -219,7 +219,7 @@ public: void setHttpStatus(const LLCore::HttpStatus &status); private: - void init(XMLRPC_REQUEST request, bool useGzip); + void init(XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams); }; LLXMLRPCTransaction::Handler::Handler(LLCore::HttpRequest::ptr_t &request, @@ -315,13 +315,13 @@ void LLXMLRPCTransaction::Handler::onCompleted(LLCore::HttpHandle handle, //========================================================================= LLXMLRPCTransaction::Impl::Impl(const std::string& uri, - XMLRPC_REQUEST request, bool useGzip) + XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams) : mHttpRequest(), mStatus(LLXMLRPCTransaction::StatusNotStarted), mURI(uri), mResponse(0) { - init(request, useGzip); + init(request, useGzip, httpParams); } @@ -337,7 +337,7 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri, XMLRPC_RequestSetRequestType(request, xmlrpc_request_call); XMLRPC_RequestSetData(request, params.getValue()); - init(request, useGzip); + init(request, useGzip, LLSD()); // DEV-28398: without this XMLRPC_RequestFree() call, it looks as though // the 'request' object is simply leaked. It's less clear to me whether we // should also ask to free request value data (second param 1), since the @@ -345,7 +345,7 @@ LLXMLRPCTransaction::Impl::Impl(const std::string& uri, XMLRPC_RequestFree(request, 1); } -void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) +void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams) { LLCore::HttpOptions::ptr_t httpOpts; LLCore::HttpHeaders::ptr_t httpHeaders; @@ -359,7 +359,15 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) // LLRefCounted starts with a 1 ref, so don't add a ref in the smart pointer httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); - httpOpts->setTimeout(40L); + // delay between repeats will start from 5 sec and grow to 20 sec with each repeat + httpOpts->setMinBackoff(5E6L); + httpOpts->setMaxBackoff(20E6L); + + httpOpts->setTimeout(httpParams.has("timeout") ? httpParams["timeout"].asInteger() : 40L); + if (httpParams.has("retries")) + { + httpOpts->setRetries(httpParams["retries"].asInteger()); + } bool vefifySSLCert = !gSavedSettings.getBOOL("NoVerifySSLCert"); mCertStore = gSavedSettings.getString("CertStore"); @@ -526,8 +534,8 @@ void LLXMLRPCTransaction::Impl::setHttpStatus(const LLCore::HttpStatus &status) LLXMLRPCTransaction::LLXMLRPCTransaction( - const std::string& uri, XMLRPC_REQUEST request, bool useGzip) -: impl(* new Impl(uri, request, useGzip)) + const std::string& uri, XMLRPC_REQUEST request, bool useGzip, const LLSD& httpParams) +: impl(* new Impl(uri, request, useGzip, httpParams)) { } diff --git a/indra/newview/llxmlrpctransaction.h b/indra/newview/llxmlrpctransaction.h index 3a1c9c82b7..7a9bc991f7 100644 --- a/indra/newview/llxmlrpctransaction.h +++ b/indra/newview/llxmlrpctransaction.h @@ -85,7 +85,7 @@ class LLXMLRPCTransaction { public: LLXMLRPCTransaction(const std::string& uri, - XMLRPC_REQUEST request, bool useGzip = true); + XMLRPC_REQUEST request, bool useGzip = true, const LLSD& httpParams = LLSD()); // does not take ownership of the request object // request can be freed as soon as the transaction is constructed -- cgit v1.2.3