From 80fe2157fe43e46f16b33fc75ab8ef7de428d275 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 15 Aug 2020 12:36:27 +0300 Subject: SL-13783 Workaround for enqueueCoprocedure() crash with asset storage --- indra/llmessage/llcoproceduremanager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llmessage/llcoproceduremanager.cpp') diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 74cdff2b00..e1ca388dd7 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -137,6 +137,12 @@ LLCoprocedureManager::~LLCoprocedureManager() } +void LLCoprocedureManager::initSingleton() +{ + // workaround until we get mutex into initializePool + initializePool("VAssetStorage"); +} + LLCoprocedureManager::poolPtr_t LLCoprocedureManager::initializePool(const std::string &poolName) { // Attempt to look up a pool size in the configuration. If found use that -- cgit v1.2.3 From 58ba75f6dd4c7c5c93ea9f14cef7f2194aa00e08 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 18 Aug 2020 16:00:25 +0300 Subject: SL-13783 Workaround for enqueueCoprocedure() crash #2 --- indra/llmessage/llcoproceduremanager.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'indra/llmessage/llcoproceduremanager.cpp') diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 0684f47df2..3f55bda1e3 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -140,12 +140,6 @@ LLCoprocedureManager::~LLCoprocedureManager() close(); } -void LLCoprocedureManager::initSingleton() -{ - // workaround until we get mutex into initializePool - initializePool("VAssetStorage"); -} - LLCoprocedureManager::poolPtr_t LLCoprocedureManager::initializePool(const std::string &poolName) { // Attempt to look up a pool size in the configuration. If found use that @@ -197,8 +191,13 @@ LLUUID LLCoprocedureManager::enqueueCoprocedure(const std::string &pool, const s void LLCoprocedureManager::setPropertyMethods(SettingQuery_t queryfn, SettingUpdate_t updatefn) { + // functions to discover and store the pool sizes mPropertyQueryFn = queryfn; mPropertyDefineFn = updatefn; + + // workaround until we get mutex into initializePool + initializePool("VAssetStorage"); + initializePool("Upload"); } //------------------------------------------------------------------------- -- cgit v1.2.3 From e4350fb9ef1a44416f0ef7873595db41b05dafc4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 19 Aug 2020 21:27:58 +0300 Subject: SL-13811 Crash on coroprocedure Coroprosedure should stop on 'stop' exception --- indra/llmessage/llcoproceduremanager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/llmessage/llcoproceduremanager.cpp') diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 3f55bda1e3..969cd162fb 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -415,6 +415,14 @@ void LLCoprocedurePool::coprocedureInvokerCoro( { coproc->mProc(httpAdapter, coproc->mId); } + catch (const LLCoros::Stop &) + { + LL_INFOS("CoProcMgr") << "Viewer is shutting Down. Stopping coprocedure('" << coproc->mName + << "', id=" << coproc->mId.asString() + << ") in pool '" << mPoolName << "'" << LL_ENDL; + mActiveCoprocs.erase(itActive); + throw; // let toplevel handle this as LLContinueError + } catch (...) { LOG_UNHANDLED_EXCEPTION(STRINGIZE("Coprocedure('" << coproc->mName -- cgit v1.2.3 From 2f52a37e6a240a4a950779f2ef769a4fbd3baaf5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 22 Aug 2020 23:01:20 +0300 Subject: SL-13811 Crash on coroprocedure --- indra/llmessage/llcoproceduremanager.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'indra/llmessage/llcoproceduremanager.cpp') diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 969cd162fb..2494c31613 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -77,12 +77,12 @@ public: /// inline size_t countActive() const { - return mActiveCoprocs.size(); + return mActiveCoprocsCount; } /// Returns the total number of coprocedures either queued or in active processing. /// - inline size_t count() const + inline S32 count() const { return countPending() + countActive(); } @@ -113,12 +113,10 @@ private: // because the consuming coroutine might outlive this LLCoprocedurePool // instance. typedef boost::shared_ptr CoprocQueuePtr; - typedef std::map ActiveCoproc_t; std::string mPoolName; - size_t mPoolSize, mPending{0}; + size_t mPoolSize, mActiveCoprocsCount, mPending; CoprocQueuePtr mPendingCoprocs; - ActiveCoproc_t mActiveCoprocs; LLTempBoundListener mStatusListener; typedef std::map CoroAdapterMap_t; @@ -281,6 +279,8 @@ void LLCoprocedureManager::close(const std::string &pool) LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size): mPoolName(poolName), mPoolSize(size), + mActiveCoprocsCount(0), + mPending(0), mPendingCoprocs(boost::make_shared(DEFAULT_QUEUE_SIZE)), mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mCoroMapping() @@ -406,8 +406,7 @@ void LLCoprocedurePool::coprocedureInvokerCoro( } // we actually popped an item --mPending; - - ActiveCoproc_t::iterator itActive = mActiveCoprocs.insert(ActiveCoproc_t::value_type(coproc->mId, httpAdapter)).first; + mActiveCoprocsCount++; LL_DEBUGS("CoProcMgr") << "Dequeued and invoking coprocedure(" << coproc->mName << ") with id=" << coproc->mId.asString() << " in pool \"" << mPoolName << "\" (" << mPending << " left)" << LL_ENDL; @@ -417,10 +416,6 @@ void LLCoprocedurePool::coprocedureInvokerCoro( } catch (const LLCoros::Stop &) { - LL_INFOS("CoProcMgr") << "Viewer is shutting Down. Stopping coprocedure('" << coproc->mName - << "', id=" << coproc->mId.asString() - << ") in pool '" << mPoolName << "'" << LL_ENDL; - mActiveCoprocs.erase(itActive); throw; // let toplevel handle this as LLContinueError } catch (...) @@ -429,13 +424,13 @@ void LLCoprocedurePool::coprocedureInvokerCoro( << "', id=" << coproc->mId.asString() << ") in pool '" << mPoolName << "'")); // must NOT omit this or we deplete the pool - mActiveCoprocs.erase(itActive); + mActiveCoprocsCount--; continue; } LL_DEBUGS("CoProcMgr") << "Finished coprocedure(" << coproc->mName << ")" << " in pool \"" << mPoolName << "\"" << LL_ENDL; - mActiveCoprocs.erase(itActive); + mActiveCoprocsCount--; } } -- cgit v1.2.3 From a42045994dacbf687cb986d8f1a644f0399cffb5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 28 Aug 2020 01:22:35 +0300 Subject: SL-13555 'Second Life quit unexpectedly' error message --- indra/llmessage/llcoproceduremanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llmessage/llcoproceduremanager.cpp') diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 2494c31613..26684a4d9e 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -414,8 +414,10 @@ void LLCoprocedurePool::coprocedureInvokerCoro( { coproc->mProc(httpAdapter, coproc->mId); } - catch (const LLCoros::Stop &) + catch (const LLCoros::Stop &e) { + LL_INFOS("LLCoros") << "coprocedureInvokerCoro terminating because " + << e.what() << LL_ENDL; throw; // let toplevel handle this as LLContinueError } catch (...) -- cgit v1.2.3