Add improved timeout handling for HTTP transactions.
Introduces AIHTTPTimeoutPolicy objects which do not just specify a single "timeout" in seconds, but a plethora of timings related to the life cycle of the average HTTP transaction. This knowledge is that moved to the Responder being used instead of floating constants hardcoded in the callers of http requests. This assumes that the same timeout policy is wanted for each transaction that uses the same Responder, which can be enforced is needed. I added a AIHTTPTimeoutPolicy for EVERY responder, only to make it easier later to tune timeout values and/or to get feedback about which responder runs into HTTP errors in debug output (especially time outs), so that they can be tuned later. If we already understood exactly what we were doing then most responders could have been left alone and just return the default timeout policy: by far most timeout policies are just a copy of the default policy, currently. This commit is not finished... It's a work in progress (viewer runs fine with it though).
This commit is contained in:
@@ -54,6 +54,10 @@
|
||||
#include "llstartup.h"
|
||||
#include "llbuffer.h"
|
||||
|
||||
class AIHTTPTimeoutPolicy;
|
||||
extern AIHTTPTimeoutPolicy HTTPGetResponder_timeout;
|
||||
extern AIHTTPTimeoutPolicy lcl_responder_timeout;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
class LLTextureFetchWorker : public LLWorkerClass
|
||||
{
|
||||
@@ -288,7 +292,6 @@ private:
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class HTTPGetResponder : public LLCurl::Responder
|
||||
{
|
||||
LOG_CLASS(HTTPGetResponder);
|
||||
@@ -301,6 +304,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return HTTPGetResponder_timeout; }
|
||||
|
||||
virtual void completedRaw(U32 status, const std::string& reason,
|
||||
const LLChannelDescriptors& channels,
|
||||
const buffer_ptr_t& buffer)
|
||||
@@ -3036,8 +3041,7 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
|
||||
volatile const S32 & live_sequence,
|
||||
volatile bool & reporting_break,
|
||||
volatile bool & reporting_started)
|
||||
: LLCurl::Responder(),
|
||||
mFetcher(fetcher),
|
||||
: mFetcher(fetcher),
|
||||
mExpectedSequence(expected_sequence),
|
||||
mLiveSequence(live_sequence),
|
||||
mReportingBreak(reporting_break),
|
||||
@@ -3071,6 +3075,7 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
|
||||
mReportingStarted = true;
|
||||
}
|
||||
}
|
||||
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return lcl_responder_timeout; }
|
||||
|
||||
private:
|
||||
LLTextureFetch * mFetcher;
|
||||
|
||||
Reference in New Issue
Block a user