diff options
| author | Dave Parks <davep@lindenlab.com> | 2012-11-08 13:54:28 -0600 | 
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2012-11-08 13:54:28 -0600 | 
| commit | 460002b134d1bd0f12e20ebdc8fecd1958cdb59f (patch) | |
| tree | 55323b5825a2a425fca5cbe58a0e31beb34bca90 | |
| parent | 7f639cb715af7f63bd8780c04a84eff8fa07a87a (diff) | |
MAINT-1311 Followup on logging and assertions of mesh loading errors
| -rwxr-xr-x | indra/newview/llmeshrepository.cpp | 64 | ||||
| -rw-r--r-- | indra/newview/llmeshrepository.h | 6 | 
2 files changed, 64 insertions, 6 deletions
| diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 4cd50ecd15..4345434f65 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -209,14 +209,23 @@ public:  	LLMeshHeaderResponder(const LLVolumeParams& mesh_params)  		: mMeshParams(mesh_params)  	{ -		LLMeshRepoThread::sActiveHeaderRequests++; +		LLMeshRepoThread::incActiveHeaderRequests();  		mProcessed = false;  	}  	~LLMeshHeaderResponder()  	{ -		llassert(mProcessed); -		LLMeshRepoThread::sActiveHeaderRequests--; +		if (!mProcessed && !LLApp::isQuitting()) +		{ //something went wrong, retry +			llwarns << "Timeout or service unavailable, retrying." << llendl; +			LLMeshRepository::sHTTPRetryCount++; +			LLMeshRepoThread::HeaderRequest req(mMeshParams); +			LLMutexLock lock(gMeshRepo.mThread->mMutex); +			gMeshRepo.mThread->mHeaderReqQ.push(req); + +		} + +		LLMeshRepoThread::decActiveHeaderRequests();  	}  	virtual void completedRaw(U32 status, const std::string& reason, @@ -237,14 +246,19 @@ public:  	LLMeshLODResponder(const LLVolumeParams& mesh_params, S32 lod, U32 offset, U32 requested_bytes)  		: mMeshParams(mesh_params), mLOD(lod), mOffset(offset), mRequestedBytes(requested_bytes)  	{ -		LLMeshRepoThread::sActiveLODRequests++; +		LLMeshRepoThread::incActiveLODRequests();  		mProcessed = false;  	}  	~LLMeshLODResponder()  	{ -		llassert(mProcessed); -		LLMeshRepoThread::sActiveLODRequests--; +		if (!mProcessed && !LLApp::isQuitting()) +		{ +			llwarns << "Killed without being processed, retrying." << llendl; +			LLMeshRepository::sHTTPRetryCount++; +			gMeshRepo.mThread->lockAndLoadMeshLOD(mMeshParams, mLOD); +		} +		LLMeshRepoThread::decActiveLODRequests();  	}  	virtual void completedRaw(U32 status, const std::string& reason, @@ -665,6 +679,16 @@ void LLMeshRepoThread::loadMeshPhysicsShape(const LLUUID& mesh_id)  	mPhysicsShapeRequests.insert(mesh_id);  } +void LLMeshRepoThread::lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32 lod) +{ +	if (!LLAppViewer::isQuitting()) +	{ +		LLMutexLock lock(mSignal); +		loadMeshLOD(mesh_params, lod); +	} +} + +  void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod)  { //protected by mSignal, no locking needed here @@ -972,6 +996,34 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)  	return ret;  } +//static +void LLMeshRepoThread::incActiveLODRequests() +{ +	LLMutexLock lock(gMeshRepo.mThread->mMutex); +	++LLMeshRepoThread::sActiveLODRequests; +} + +//static +void LLMeshRepoThread::decActiveLODRequests() +{ +	LLMutexLock lock(gMeshRepo.mThread->mMutex); +	--LLMeshRepoThread::sActiveLODRequests; +} + +//static +void LLMeshRepoThread::incActiveHeaderRequests() +{ +	LLMutexLock lock(gMeshRepo.mThread->mMutex); +	++LLMeshRepoThread::sActiveHeaderRequests; +} + +//static +void LLMeshRepoThread::decActiveHeaderRequests() +{ +	LLMutexLock lock(gMeshRepo.mThread->mMutex); +	--LLMeshRepoThread::sActiveHeaderRequests; +} +  //return false if failed to get header  bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& count)  { diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 6e301c26a2..8eaf691d6f 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -322,7 +322,9 @@ public:  	virtual void run(); +	void lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32 lod);  	void loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod); +  	bool fetchMeshHeader(const LLVolumeParams& mesh_params, U32& count);  	bool fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count);  	bool headerReceived(const LLVolumeParams& mesh_params, U8* data, S32 data_size); @@ -351,6 +353,10 @@ public:  	//  (should hold onto mesh_id and try again later if header info does not exist)  	bool fetchMeshPhysicsShape(const LLUUID& mesh_id); +	static void incActiveLODRequests(); +	static void decActiveLODRequests(); +	static void incActiveHeaderRequests(); +	static void decActiveHeaderRequests();  }; | 
