From 1310630ac60ba292f52761e795eaa55610818b9b Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Fri, 12 Apr 2013 20:11:17 +0000 Subject: SH-4090 [WIP] Basic deadman timer integration started on Linux. Moving to windows to do real work. --- indra/newview/llmeshrepository.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 8602271f84..f08feedf81 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -32,6 +32,7 @@ #include "lluuid.h" #include "llviewertexture.h" #include "llvolume.h" +#include "lldeadmantimer.h" #define LLCONVEXDECOMPINTER_STATIC 1 @@ -455,14 +456,15 @@ public: static U32 sCacheBytesRead; static U32 sCacheBytesWritten; static U32 sPeakKbps; - + static LLDeadmanTimer sQuiescentTimer; // time-to-complete-mesh-downloads after significant events + static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); LLMeshRepository(); void init(); void shutdown(); - S32 update() ; + S32 update(); //mesh management functions S32 loadMesh(LLVOVolume* volume, const LLVolumeParams& mesh_params, S32 detail = 0, S32 last_lod = -1); @@ -495,6 +497,11 @@ public: S32 getMeshSize(const LLUUID& mesh_id, S32 lod); + // Quiescent timer management, main thread only. + static void metricsStart(); + static void metricsStop(); + static void metricsCheck(); + typedef std::map > mesh_load_map; mesh_load_map mLoadingMeshes[4]; -- cgit v1.2.3 From e59d59878200d25dc6e94753026d986d2704ab8d Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Wed, 17 Apr 2013 18:30:46 -0400 Subject: SH-4090 Integrating deadman timer with mesh repo downloads. Timer interface violated my design rules and I paid for it with clumsiness and silent errors. Cleaned it up mainly removing the evil default values. Found better integration points in the mesh downloader and it's producing fairly consistent numbers on the MeshTest2 test region (about 5500 downloads, ~90 seconds, +/- 10 seconds). Will review with davep and do an early timer stop on teleport which invalidates a timing sequence. --- indra/newview/llmeshrepository.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index f08feedf81..3cdc66e1f0 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -500,7 +500,8 @@ public: // Quiescent timer management, main thread only. static void metricsStart(); static void metricsStop(); - static void metricsCheck(); + static void metricsProgress(unsigned int count); + static void metricsUpdate(); typedef std::map > mesh_load_map; mesh_load_map mLoadingMeshes[4]; -- cgit v1.2.3 From 2df0a2494691ebfdd305e6a5ee280dd758a1b337 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Tue, 7 May 2013 16:18:31 +0000 Subject: SH-4139 Convert http downloaders and responders to llcorehttp patterns Initial work completed on linux, moving over to windows to do debug and refinement. This includes 5/6 handlers based on existing responders and use of llcorehttp for the mesh header fetch. --- indra/newview/llmeshrepository.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 3cdc66e1f0..8ffe2d68cb 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2010-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,11 @@ #include "llviewertexture.h" #include "llvolume.h" #include "lldeadmantimer.h" +#include "httpcommon.h" +#include "httprequest.h" +#include "httpoptions.h" +#include "httpheaders.h" +#include "httphandler.h" #define LLCONVEXDECOMPINTER_STATIC 1 @@ -316,6 +321,15 @@ public: typedef std::map > pending_lod_map; pending_lod_map mPendingLOD; + // llcorehttp library interface objects. + LLCore::HttpRequest * mHttpRequest; + LLCore::HttpOptions * mHttpOptions; + LLCore::HttpHeaders * mHttpHeaders; + LLCore::HttpRequest::policy_t mHttpPolicyClass; + + typedef std::set http_request_set; + http_request_set mHttpRequestSet; // Outstanding HTTP requests + static std::string constructUrl(LLUUID mesh_id); LLMeshRepoThread(); -- cgit v1.2.3 From 7c9d0b58aca072ff932b30f927e2876dfc6858aa Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Fri, 7 Jun 2013 20:14:52 -0400 Subject: Mostly cleanup. A chunk of comment code nobody needs. Dereference after delete, erase() on end() iterator, a few more like that. Killed a dead variable. --- indra/newview/llmeshrepository.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 8ffe2d68cb..62f81ce9e2 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -469,7 +469,6 @@ public: static U32 sLODProcessing; static U32 sCacheBytesRead; static U32 sCacheBytesWritten; - static U32 sPeakKbps; static LLDeadmanTimer sQuiescentTimer; // time-to-complete-mesh-downloads after significant events static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); -- cgit v1.2.3 From 626752beab7c12a355ab707d70aba6f4fe096c10 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Wed, 19 Jun 2013 13:55:54 -0400 Subject: SH-4252 Add second policy class for large mesh asset downloads Added second mesh class as well as an asset upload class. Refactored initialization to use less code and more data to cleanly get http started. Modified mesh to use the new http class for large requests (>2MB for now). Added additional timeout setting to llcorehttp to distinguish connection timeout from transport timeout and are now using transport timeout values for large asset downloads that may need more time. --- indra/newview/llmeshrepository.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 62f81ce9e2..0dca29e7d4 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -224,13 +224,14 @@ public: static S32 sActiveHeaderRequests; static S32 sActiveLODRequests; static U32 sMaxConcurrentRequests; + static S32 sRequestLowWater; + static S32 sRequestHighWater; - LLCurlRequest* mCurlRequest; LLMutex* mMutex; LLMutex* mHeaderMutex; LLCondition* mSignal; - bool mWaiting; + volatile bool mWaiting; //map of known mesh headers typedef std::map mesh_header_map; @@ -324,8 +325,11 @@ public: // llcorehttp library interface objects. LLCore::HttpRequest * mHttpRequest; LLCore::HttpOptions * mHttpOptions; + LLCore::HttpOptions * mHttpLargeOptions; LLCore::HttpHeaders * mHttpHeaders; LLCore::HttpRequest::policy_t mHttpPolicyClass; + LLCore::HttpRequest::policy_t mHttpLargePolicyClass; + LLCore::HttpRequest::priority_t mHttpPriority; typedef std::set http_request_set; http_request_set mHttpRequestSet; // Outstanding HTTP requests @@ -373,6 +377,19 @@ public: static void incActiveHeaderRequests(); static void decActiveHeaderRequests(); +private: + // Issue a GET request to a URL with 'Range' header using + // the correct policy class and other attributes. If an invalid + // handle is returned, the request failed and caller must retry + // or dispose of handler. + // + // Threads: Repo thread only + LLCore::HttpHandle getByteRange(const std::string & url, size_t offset, size_t len, + LLCore::HttpHandler * handler); + +private: + U32 mHttpGetCount; + U32 mHttpLargeGetCount; }; class LLMeshUploadThread : public LLThread -- cgit v1.2.3 From d6cbcd591aea32357d50b266efe8a95754302cbf Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Thu, 20 Jun 2013 19:18:39 -0400 Subject: SH-4257 Preparation for a new cap grant: GetMesh2 Mesh repo is using three policy classes now: one for large objects, one for GetMesh2 regions, one for GetMesh regions. It's also detecting the presence of the cap and using the correct class. Class initialization cleaned up significantly in llappcorehttp using data-directed code. Pulled in the changes to HttpHeader done for sunshine-internal then did a refactoring pass on the header callback which now uses a unified approach to clean up and deliver header information to all interested parties. Added support for using Retry-After header information on 503 retries. --- indra/newview/llmeshrepository.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 0dca29e7d4..74690e5a2a 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -328,13 +328,14 @@ public: LLCore::HttpOptions * mHttpLargeOptions; LLCore::HttpHeaders * mHttpHeaders; LLCore::HttpRequest::policy_t mHttpPolicyClass; + LLCore::HttpRequest::policy_t mHttpLegacyPolicyClass; LLCore::HttpRequest::policy_t mHttpLargePolicyClass; LLCore::HttpRequest::priority_t mHttpPriority; typedef std::set http_request_set; http_request_set mHttpRequestSet; // Outstanding HTTP requests - static std::string constructUrl(LLUUID mesh_id); + static std::string constructUrl(LLUUID mesh_id, int * cap_version); LLMeshRepoThread(); ~LLMeshRepoThread(); @@ -384,7 +385,8 @@ private: // or dispose of handler. // // Threads: Repo thread only - LLCore::HttpHandle getByteRange(const std::string & url, size_t offset, size_t len, + LLCore::HttpHandle getByteRange(const std::string & url, int cap_version, + size_t offset, size_t len, LLCore::HttpHandler * handler); private: @@ -595,7 +597,7 @@ public: void updateInventory(inventory_data data); std::string mGetMeshCapability; - + std::string mGetMesh2Capability; }; extern LLMeshRepository gMeshRepo; -- cgit v1.2.3 From 2cdddab384ce0bf4f6786a3fee08bea3f467e7c9 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Thu, 27 Jun 2013 13:55:05 -0400 Subject: SH-4310/BUG-2810/MAINT-2794 Better status checking and error logging in Mesh code. Pay correct attention to status codes coming back from services. Generate better and consistent error messages when problems arise. There's more to do in error handling, need a way to cleanly fail all request types, only have that for LOD at this point. Do better keeping the HTTP pipeline between the low and high water marks. This was made challenging because the outer most code couldn't really see what's going on internally (whose actions are delayed in a worker thread). More to do here, the debug-like requests don't honor limits, that will come later. Made retry counts available from llcorehttp which can be used by the throttle-anticipating logic to advance the count. It helps but it reinforces the coupling between viewer and server which I do not like. --- indra/newview/llmeshrepository.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 74690e5a2a..e90ab4dd23 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -221,8 +221,8 @@ class LLMeshRepoThread : public LLThread { public: - static S32 sActiveHeaderRequests; - static S32 sActiveLODRequests; + volatile static S32 sActiveHeaderRequests; + volatile static S32 sActiveLODRequests; static U32 sMaxConcurrentRequests; static S32 sRequestLowWater; static S32 sRequestHighWater; @@ -323,6 +323,8 @@ public: pending_lod_map mPendingLOD; // llcorehttp library interface objects. + LLCore::HttpStatus mHttpStatus; + unsigned int mHttpRetries; LLCore::HttpRequest * mHttpRequest; LLCore::HttpOptions * mHttpOptions; LLCore::HttpOptions * mHttpLargeOptions; -- cgit v1.2.3 From 350e658348431e4b1f0e5038cf999d9722a699aa Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Thu, 27 Jun 2013 20:38:18 -0400 Subject: SH-4311 Get highwater limiting of requests into llhttpcore working. Fixed the logic and have it covering all five types of requests now with validation via an assert (when enabled). Should keep things working smoothly and avoid floods of 503s when in debug modes. Also started a round of file-level documentation detailing thread usage and mutex coverage. More to do, more to describe. But the high- water stuff is functioning correctly. --- indra/newview/llmeshrepository.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index e90ab4dd23..9bf14a3715 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -365,15 +365,15 @@ public: //send request for skin info, returns true if header info exists // (should hold onto mesh_id and try again later if header info does not exist) - bool fetchMeshSkinInfo(const LLUUID& mesh_id); + bool fetchMeshSkinInfo(const LLUUID& mesh_id, U32& count); //send request for decomposition, returns true if header info exists // (should hold onto mesh_id and try again later if header info does not exist) - bool fetchMeshDecomposition(const LLUUID& mesh_id); + bool fetchMeshDecomposition(const LLUUID& mesh_id, U32& count); //send request for PhysicsShape, returns true if header info exists // (should hold onto mesh_id and try again later if header info does not exist) - bool fetchMeshPhysicsShape(const LLUUID& mesh_id); + bool fetchMeshPhysicsShape(const LLUUID& mesh_id, U32& count); static void incActiveLODRequests(); static void decActiveLODRequests(); -- cgit v1.2.3 From d027db3cfc7c757cc8846e1a5187d1a816f63d9a Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Thu, 18 Jul 2013 15:14:55 -0400 Subject: SH-4325 Viewer working mixed grid with GetMesh and GetMesh2 caps Viewer modified for preference for GetMesh2 caps. When found, uses this cap and uses 1/4 the connection concurrency specified by MeshMaxConcurrentRequests. Also uses a modified calculation for high/low water feeding into the llcorehttp library. --- indra/newview/llmeshrepository.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 9bf14a3715..96e9feea9d 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -337,7 +337,7 @@ public: typedef std::set http_request_set; http_request_set mHttpRequestSet; // Outstanding HTTP requests - static std::string constructUrl(LLUUID mesh_id, int * cap_version); + static std::string constructUrl(LLUUID mesh_id); LLMeshRepoThread(); ~LLMeshRepoThread(); @@ -600,6 +600,7 @@ public: std::string mGetMeshCapability; std::string mGetMesh2Capability; + int mGetMeshVersion; }; extern LLMeshRepository gMeshRepo; -- cgit v1.2.3 From b7f14a7b39610ac1cb6db5fafeab568aa9b662c5 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Thu, 25 Jul 2013 18:36:08 -0400 Subject: SH-4365 SH-4367 Conversion of mesh uploaders to llcorehttp. With this checkin, legacy LLCurl is out of the mesh code. Uploaders and responders are converted and functioning. Logging has been cleaned up throughout the code to use the macro form with tag/subtag capability. DEBUGS-level logging added for some upload path milestones. Better error information flow from failed responses to viewer alert boxes but I'd really, really like to do better here. Mesh upload problems are completely opaque as a user. Minor cleanups (removed dead members, method signatures tidied, less data conversion). Could almost call this complete, will likely have platform cleanups, however. --- indra/newview/llmeshrepository.h | 48 ++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 17 deletions(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 96e9feea9d..70079eed23 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -45,8 +45,6 @@ #include "lluploadfloaterobservers.h" class LLVOVolume; -class LLMeshResponder; -class LLCurlRequest; class LLMutex; class LLCondition; class LLVFS; @@ -396,7 +394,14 @@ private: U32 mHttpLargeGetCount; }; -class LLMeshUploadThread : public LLThread + +// Class whose instances represent a single upload-type request for +// meshes: one fee query or one actual upload attempt. Yes, it creates +// a unique thread for that single request. As it is 1:1, it can also +// trivially serve as the HttpHandler object for request completion +// notifications. + +class LLMeshUploadThread : public LLThread, public LLCore::HttpHandler { private: S32 mMeshUploadTimeOut ; //maximum time in seconds to execute an uploading request. @@ -417,44 +422,41 @@ public: }; LLPointer mFinalDecomp; - bool mPhysicsComplete; + volatile bool mPhysicsComplete; typedef std::map, std::vector > hull_map; - hull_map mHullMap; + hull_map mHullMap; typedef std::vector instance_list; - instance_list mInstanceList; + instance_list mInstanceList; typedef std::map, instance_list> instance_map; - instance_map mInstance; + instance_map mInstance; - LLMutex* mMutex; - LLCurlRequest* mCurlRequest; + LLMutex* mMutex; S32 mPendingUploads; LLVector3 mOrigin; bool mFinished; bool mUploadTextures; bool mUploadSkin; bool mUploadJoints; - BOOL mDiscarded ; + BOOL mDiscarded; LLHost mHost; std::string mWholeModelFeeCapability; std::string mWholeModelUploadURL; LLMeshUploadThread(instance_list& data, LLVector3& scale, bool upload_textures, - bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true, - LLHandle fee_observer= (LLHandle()), LLHandle upload_observer = (LLHandle())); + bool upload_skin, bool upload_joints, const std::string & upload_url, bool do_upload = true, + LLHandle fee_observer = (LLHandle()), + LLHandle upload_observer = (LLHandle())); ~LLMeshUploadThread(); - void startRequest() { ++mPendingUploads; } - void stopRequest() { --mPendingUploads; } - - bool finished() { return mFinished; } + bool finished() const { return mFinished; } virtual void run(); void preStart(); void discard() ; - BOOL isDiscarded(); + BOOL isDiscarded() const; void generateHulls(); @@ -471,11 +473,23 @@ public: void setFeeObserverHandle(LLHandle observer_handle) { mFeeObserverHandle = observer_handle; } void setUploadObserverHandle(LLHandle observer_handle) { mUploadObserverHandle = observer_handle; } + // Inherited from LLCore::HttpHandler + virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + private: LLHandle mFeeObserverHandle; LLHandle mUploadObserverHandle; bool mDoUpload; // if FALSE only model data will be requested, otherwise the model will be uploaded + LLSD mModelData; + + // llcorehttp library interface objects. + LLCore::HttpStatus mHttpStatus; + LLCore::HttpRequest * mHttpRequest; + LLCore::HttpOptions * mHttpOptions; + LLCore::HttpHeaders * mHttpHeaders; + LLCore::HttpRequest::policy_t mHttpPolicyClass; + LLCore::HttpRequest::priority_t mHttpPriority; }; class LLMeshRepository -- cgit v1.2.3 From f3927c6ca2aad757fe88fdd59b87986ca8b207a8 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Tue, 30 Jul 2013 15:21:31 -0400 Subject: SH-4371 Reduce 22mS inter-connection latency. This really extended into the client-side request throttling. Moved this from llmeshrepository (which doesn't really want to do connection management) into llcorehttp. It's now a class option with configurable rate. This still isn't the right thing to do as it creates coupling between viewer and services. When we get to pipelining, this notion becomes invalid. --- indra/newview/llmeshrepository.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 70079eed23..400ceb4ad7 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -322,7 +322,6 @@ public: // llcorehttp library interface objects. LLCore::HttpStatus mHttpStatus; - unsigned int mHttpRetries; LLCore::HttpRequest * mHttpRequest; LLCore::HttpOptions * mHttpOptions; LLCore::HttpOptions * mHttpLargeOptions; @@ -345,8 +344,8 @@ public: 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 fetchMeshHeader(const LLVolumeParams& mesh_params); + bool fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod); bool headerReceived(const LLVolumeParams& mesh_params, U8* data, S32 data_size); bool lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size); bool skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 data_size); @@ -363,15 +362,15 @@ public: //send request for skin info, returns true if header info exists // (should hold onto mesh_id and try again later if header info does not exist) - bool fetchMeshSkinInfo(const LLUUID& mesh_id, U32& count); + bool fetchMeshSkinInfo(const LLUUID& mesh_id); //send request for decomposition, returns true if header info exists // (should hold onto mesh_id and try again later if header info does not exist) - bool fetchMeshDecomposition(const LLUUID& mesh_id, U32& count); + bool fetchMeshDecomposition(const LLUUID& mesh_id); //send request for PhysicsShape, returns true if header info exists // (should hold onto mesh_id and try again later if header info does not exist) - bool fetchMeshPhysicsShape(const LLUUID& mesh_id, U32& count); + bool fetchMeshPhysicsShape(const LLUUID& mesh_id); static void incActiveLODRequests(); static void decActiveLODRequests(); -- cgit v1.2.3 From 43788d612042deb6f9329746a101774370f7c67b Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Mon, 5 Aug 2013 19:04:08 -0400 Subject: Added some simple counters to the mesh repository code and then added a Mesh status line to the texture fetch console. Mesh is often in competition with textures and so the mesh information seems appropriate there. Do get a nice feel for progress and you definitely see when the throttles kick in. --- indra/newview/llmeshrepository.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 400ceb4ad7..7e89f60bc3 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -224,6 +224,7 @@ public: static U32 sMaxConcurrentRequests; static S32 sRequestLowWater; static S32 sRequestHighWater; + static S32 sRequestWaterLevel; // Stats-use only, may read outside of thread LLMutex* mMutex; LLMutex* mHeaderMutex; @@ -387,10 +388,6 @@ private: LLCore::HttpHandle getByteRange(const std::string & url, int cap_version, size_t offset, size_t len, LLCore::HttpHandler * handler); - -private: - U32 mHttpGetCount; - U32 mHttpLargeGetCount; }; @@ -497,12 +494,18 @@ public: //metrics static U32 sBytesReceived; + static U32 sMeshRequestCount; static U32 sHTTPRequestCount; + static U32 sHTTPLargeRequestCount; static U32 sHTTPRetryCount; + static U32 sHTTPErrorCount; static U32 sLODPending; static U32 sLODProcessing; static U32 sCacheBytesRead; static U32 sCacheBytesWritten; + static U32 sCacheReads; + static U32 sCacheWrites; + static LLDeadmanTimer sQuiescentTimer; // time-to-complete-mesh-downloads after significant events static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); -- cgit v1.2.3 From 0d93247359531388f88f22f85326e1142d801e85 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Tue, 6 Aug 2013 18:05:34 -0400 Subject: SH-4411 Thread/mutex rework between main and worker thread Have the ::notifyLoadedMeshes() method doing correct locking and stall avoidance at the same time. This method now does lazy mutex lock acquisition (trylock()) and if it fails on either, it gives up and comes back later. Capture the maximum number of sequential failures and report this at the end of the run in the log. (So far, with big mesh regions, I've only seen 1s and 2s.) Locking/mutex requirements sorted in other locations as well. LLMutex gets trylock() method as well as new LLMutexTrylock scoped locking class. Clean up some documentation, more to do. --- indra/newview/llmeshrepository.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 7e89f60bc3..c79278da1a 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -230,8 +230,6 @@ public: LLMutex* mHeaderMutex; LLCondition* mSignal; - volatile bool mWaiting; - //map of known mesh headers typedef std::map mesh_header_map; mesh_header_map mMeshHeader; @@ -494,19 +492,20 @@ public: //metrics static U32 sBytesReceived; - static U32 sMeshRequestCount; - static U32 sHTTPRequestCount; - static U32 sHTTPLargeRequestCount; - static U32 sHTTPRetryCount; - static U32 sHTTPErrorCount; + static U32 sMeshRequestCount; // Total request count, http or cached, all component types + static U32 sHTTPRequestCount; // Http GETs issued (not large) + static U32 sHTTPLargeRequestCount; // Http GETs issued for large requests + static U32 sHTTPRetryCount; // Total request retries whether successful or failed + static U32 sHTTPErrorCount; // Requests ending in error static U32 sLODPending; static U32 sLODProcessing; static U32 sCacheBytesRead; static U32 sCacheBytesWritten; - static U32 sCacheReads; + static U32 sCacheReads; static U32 sCacheWrites; + static U32 sMaxLockHoldoffs; // Maximum sequential locking failures - static LLDeadmanTimer sQuiescentTimer; // time-to-complete-mesh-downloads after significant events + static LLDeadmanTimer sQuiescentTimer; // Time-to-complete-mesh-downloads after significant events static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL); -- cgit v1.2.3 From 2462162539053e8cbf26aea68940f300bca5aa87 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Fri, 20 Sep 2013 07:13:14 +0000 Subject: Move from std::queue to std::list which has better behavior and swap() as well. Should probably do this for the other queues at some point. --- indra/newview/llmeshrepository.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index c79278da1a..e09f39f7a8 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -291,8 +291,8 @@ public: //set of requested skin info std::set mSkinRequests; - //queue of completed skin info requests - std::queue mSkinInfoQ; + // list of completed skin info requests + std::list mSkinInfoQ; //set of requested decompositions std::set mDecompositionRequests; @@ -300,8 +300,8 @@ public: //set of requested physics shapes std::set mPhysicsShapeRequests; - //queue of completed Decomposition info requests - std::queue mDecompositionQ; + // list of completed Decomposition info requests + std::list mDecompositionQ; //queue of requested headers std::queue mHeaderReqQ; -- cgit v1.2.3 From 200bea5b418a3dc61431d26271932f8c489f0d18 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Tue, 24 Sep 2013 14:49:26 -0400 Subject: SH-3690 SH-4505 Cleanup pass through code. Start using DNS cache in legacy LLCurl code. Go to 15 seconds particularly as we're using threaded resolver at this point. Documentation cleanup. Add libcurl status checking and logging for curl_easy_setopt() operations that fail. Shouldn't happen and we'll just continue anyway but there's info in the logs to track these down now. Cleaned up logic around FASTTIMER enable defines used to evaluate pipeline stalls in main thread. Removed long-standing thread race around caps strings and URL construction. Not a significant risk but refactoring the code to get rid of them removed one huge eyesore. It can be made even slicker if desired (see notes). --- indra/newview/llmeshrepository.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index e09f39f7a8..9d8b102110 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -333,7 +333,9 @@ public: typedef std::set http_request_set; http_request_set mHttpRequestSet; // Outstanding HTTP requests - static std::string constructUrl(LLUUID mesh_id); + std::string mGetMeshCapability; + std::string mGetMesh2Capability; + int mGetMeshVersion; LLMeshRepoThread(); ~LLMeshRepoThread(); @@ -376,6 +378,17 @@ public: static void incActiveHeaderRequests(); static void decActiveHeaderRequests(); + // Set the caps strings and preferred version for constructing + // mesh fetch URLs. + // + // Mutex: must be holding mMutex when called + void setGetMeshCaps(const std::string & get_mesh1, + const std::string & get_mesh2, + int pref_version); + + // Mutex: acquires mMutex + void constructUrl(LLUUID mesh_id, std::string * url, int * version); + private: // Issue a GET request to a URL with 'Range' header using // the correct policy class and other attributes. If an invalid @@ -613,9 +626,7 @@ public: void uploadError(LLSD& args); void updateInventory(inventory_data data); - std::string mGetMeshCapability; - std::string mGetMesh2Capability; - int mGetMeshVersion; + int mGetMeshVersion; // Shadows value in LLMeshRepoThread }; extern LLMeshRepository gMeshRepo; -- cgit v1.2.3 From ea1f6a6343fe83f1352a8a839265c471640acdce Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Fri, 6 Dec 2013 16:02:53 -0500 Subject: SH-4645 Viewer hangs on exit after cancelling a mesh upload. Problem involved a 3-way livelock between the main, upload and decomposition threads. Viewer is shutting down but an upload is in the 'generate hulls' state. Main thread asks upload request to discard and spins waiting for it to finish. Upload thread is in generateHulls spinning waiting for the decomposition thread to process a mesh request. Decomposition thread is sleeping waiting for main thread to deliver work that upload thread has asked the decomposition thread to do. --- indra/newview/llmeshrepository.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llmeshrepository.h') diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 9d8b102110..39280bea3a 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -447,7 +447,7 @@ public: bool mUploadTextures; bool mUploadSkin; bool mUploadJoints; - BOOL mDiscarded; + volatile bool mDiscarded; LLHost mHost; std::string mWholeModelFeeCapability; @@ -463,7 +463,7 @@ public: virtual void run(); void preStart(); void discard() ; - BOOL isDiscarded() const; + bool isDiscarded() const; void generateHulls(); -- cgit v1.2.3