diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 7fb2b7542..9e921b406 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -603,7 +603,7 @@ bool LLMeshRepoThread::LODRequest::fetch(U32& count) return true; } -void LLMeshRepoThread::runQuery(std::queue, F32> >& query, U32& count, S32& active_requests) +void LLMeshRepoThread::runQueue(std::deque, F32> >& query, U32& count, S32& active_requests) { std::queue, F32> > incomplete; while (!query.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && active_requests < (S32)sMaxConcurrentRequests) @@ -613,19 +613,24 @@ void LLMeshRepoThread::runQuery(std::queuelock(); auto req = query.front().first; F32 delay = query.front().second; - query.pop(); + query.pop_front(); req->preFetch(); mMutex->unlock(); F32 remainder = delay - req->mTimer.getElapsedTimeF32(); if (remainder > 0.f) { + //LL_INFOS() << req->mMeshParams.getSculptID() << " skipped. " << remainder << "s remaining" << LL_ENDL; incomplete.push(std::make_pair(req, delay)); } else if (!req->fetch(count))//failed, resubmit { + LL_INFOS() << req->mMeshParams.getSculptID() << " fetch failed outright. Delaying for " << (delay ? delay : 15) << "s" << LL_ENDL; req->mTimer.reset(); incomplete.push(std::make_pair(req, delay ? delay : 15)); } + else { + //LL_INFOS() << req->mMeshParams.getSculptID() << " fetch request created. " << std::hex << &(req->mMeshParams) << std::dec << LL_ENDL; + } } } if (!incomplete.empty()) @@ -633,7 +638,7 @@ void LLMeshRepoThread::runQuery(std::queuelock(); while (!incomplete.empty()) { - query.push(incomplete.front()); + query.push_back(incomplete.front()); incomplete.pop(); } mMutex->unlock(); @@ -678,8 +683,8 @@ void LLMeshRepoThread::run() } // NOTE: throttling intentionally favors LOD requests over header requests - runQuery(mLODReqQ, count, sActiveLODRequests); - runQuery(mHeaderReqQ, count, sActiveHeaderRequests); + runQueue(mLODReqQ, count, sActiveLODRequests); + runQueue(mHeaderReqQ, count, sActiveHeaderRequests); // Protected by mSignal runSet(mSkinRequests, std::bind(&LLMeshRepoThread::fetchMeshSkinInfo, this, std::placeholders::_1)); @@ -795,9 +800,11 @@ bool LLMeshRepoThread::getMeshHeaderInfo(const LLUUID& mesh_id, const char* bloc if ((info.mHeaderSize = mMeshHeaderSize[mesh_id]) > 0) { - info.mVersion = mMeshHeader[mesh_id]["version"].asInteger(); - info.mOffset = info.mHeaderSize + mMeshHeader[mesh_id][block_name]["offset"].asInteger(); - info.mSize = mMeshHeader[mesh_id][block_name]["size"].asInteger(); + const LLSD& header = mMeshHeader[mesh_id]; + const LLSD& block = header[block_name]; + info.mVersion = header["version"].asInteger(); + info.mOffset = info.mHeaderSize + block["offset"].asInteger(); + info.mSize = block["size"].asInteger(); } return true; } @@ -1943,7 +1950,6 @@ void LLMeshRepository::cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header) void LLMeshLODResponder::retry() { - LL_INFOS() << "retry (lod)" << LL_ENDL; AIStateMachine::StateTimer timer("loadMeshLOD"); LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshLOD(mMeshParams, mLOD); @@ -2016,7 +2022,6 @@ void LLMeshLODResponder::completedRaw(LLChannelDescriptors const& channels, void LLMeshSkinInfoResponder::retry() { - LL_INFOS() << "retry" << LL_ENDL; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshSkinInfo(mMeshID); } @@ -2085,7 +2090,6 @@ void LLMeshSkinInfoResponder::completedRaw(LLChannelDescriptors const& channels, void LLMeshDecompositionResponder::retry() { - LL_INFOS() << "retry" << LL_ENDL; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshDecomposition(mMeshID); } @@ -2153,7 +2157,6 @@ void LLMeshDecompositionResponder::completedRaw(LLChannelDescriptors const& chan void LLMeshPhysicsShapeResponder::retry() { - LL_INFOS() << "retry" << LL_ENDL; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID); } @@ -2221,7 +2224,6 @@ void LLMeshPhysicsShapeResponder::completedRaw(LLChannelDescriptors const& chann void LLMeshHeaderResponder::retry() { - LL_INFOS() << "retry" << LL_ENDL; AIStateMachine::StateTimer timer("Retry"); LLMeshRepository::sHTTPRetryCount++; LLMutexLock lock(gMeshRepo.mThread->mMutex); @@ -2231,6 +2233,7 @@ void LLMeshHeaderResponder::retry() void LLMeshHeaderResponder::completedRaw(LLChannelDescriptors const& channels, LLIOPipe::buffer_ptr_t const& buffer) { + //LL_INFOS() << mMeshParams.getSculptID() << " Status: " << mStatus << LL_ENDL; mProcessed = true; // thread could have already be destroyed during logout diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 39f1e2264..a3e3f22d2 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -274,10 +274,10 @@ public: std::queue mDecompositionQ; //queue of requested headers - std::queue, F32> > mHeaderReqQ; + std::deque, F32> > mHeaderReqQ; //queue of requested LODs - std::queue, F32> > mLODReqQ; + std::deque, F32> > mLODReqQ; //queue of unavailable LODs (either asset doesn't exist or asset doesn't have desired LOD) std::queue mUnavailableQ; @@ -294,19 +294,19 @@ public: LLMeshRepoThread(); ~LLMeshRepoThread(); - void runQuery(std::queue, F32> >& query, U32& count, S32& active_requests); + void runQueue(std::deque, F32> >& queue, U32& count, S32& active_requests); void runSet(std::set& set, std::function fn); void pushHeaderRequest(const LLVolumeParams& mesh_params, F32 delay = 0) { std::shared_ptr req; req.reset(new LLMeshRepoThread::HeaderRequest(mesh_params)); - mHeaderReqQ.push(std::make_pair(req, delay)); + mHeaderReqQ.push_back(std::make_pair(req, delay)); } void pushLODRequest(const LLVolumeParams& mesh_params, S32 lod, F32 delay = 0) { std::shared_ptr req; req.reset(new LLMeshRepoThread::LODRequest(mesh_params, lod)); - mLODReqQ.push(std::make_pair(req, delay)); + mLODReqQ.push_back(std::make_pair(req, delay)); } virtual void run();