From edf0874e0656c6f512df50ee52236209531ca329 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 11 Aug 2023 23:36:37 +0300 Subject: SL-18721 Viewer shutdown order changes Same thing as commit cf692c40b0b9f8d0d04cd10a02a84e3f697a2e99 which was removed due to shutdown freezes. Error thread is no longer there so doesn't cause any race sonditions, was not able to repro any issues so will ask QA to test shutdown --- indra/llcommon/threadpool.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llcommon/threadpool.h') diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h index f8eec3b457..22c875edb9 100644 --- a/indra/llcommon/threadpool.h +++ b/indra/llcommon/threadpool.h @@ -31,7 +31,7 @@ namespace LL * Pass ThreadPool a string name. This can be used to look up the * relevant WorkQueue. */ - ThreadPool(const std::string& name, size_t threads=1, size_t capacity=1024); + ThreadPool(const std::string& name, size_t threads=1, size_t capacity=1024, bool auto_shutdown = true); virtual ~ThreadPool(); /** @@ -66,6 +66,7 @@ namespace LL std::string mName; size_t mThreadCount; std::vector> mThreads; + bool mAutomaticShutdown; }; } // namespace LL -- cgit v1.2.3 From dc2fc3488d8d1ebb2e90520dd17325f08b7c538b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 10 Oct 2023 22:32:11 +0300 Subject: Revert "SL-18721 Viewer shutdown order changes" This reverts commit edf0874e0656c6f512df50ee52236209531ca329. Reverted since it causes a significant uptick in shutdown freezes. Can't repro those freezes, will seek an alternate solution. --- indra/llcommon/threadpool.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/llcommon/threadpool.h') diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h index 22c875edb9..f8eec3b457 100644 --- a/indra/llcommon/threadpool.h +++ b/indra/llcommon/threadpool.h @@ -31,7 +31,7 @@ namespace LL * Pass ThreadPool a string name. This can be used to look up the * relevant WorkQueue. */ - ThreadPool(const std::string& name, size_t threads=1, size_t capacity=1024, bool auto_shutdown = true); + ThreadPool(const std::string& name, size_t threads=1, size_t capacity=1024); virtual ~ThreadPool(); /** @@ -66,7 +66,6 @@ namespace LL std::string mName; size_t mThreadCount; std::vector> mThreads; - bool mAutomaticShutdown; }; } // namespace LL -- cgit v1.2.3 From 4a34a1196627c7e9998edde725d5e839f3ef61b9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 20 Jan 2024 02:26:51 +0200 Subject: SL-18721 Shutdown fixes 1. After window closes viewer still takes some time to shut down, so added splash screen to not confuse users (and to see if something gets stuck) 2. Having two identical mWindowHandle caused confusion for me, so I split them. It looks like there might have been issues with thread being stuck because thread's handle wasn't cleaned up. 3. Made region clean mCacheMap immediately instead of spending time making copies on shutdown --- indra/llcommon/threadpool.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/llcommon/threadpool.h') diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h index 60f4a0ce1b..fa16c6fe71 100644 --- a/indra/llcommon/threadpool.h +++ b/indra/llcommon/threadpool.h @@ -40,7 +40,7 @@ namespace LL * overrides this parameter. */ ThreadPoolBase(const std::string& name, size_t threads, - WorkQueueBase* queue); + WorkQueueBase* queue, bool auto_shutdown = true); virtual ~ThreadPoolBase(); /** @@ -87,6 +87,7 @@ namespace LL protected: std::unique_ptr mQueue; + bool mAutomaticShutdown; private: void run(const std::string& name); @@ -117,8 +118,11 @@ namespace LL * Constraining the queue can cause a submitter to block. Do not * constrain any ThreadPool accepting work from the main thread. */ - ThreadPoolUsing(const std::string& name, size_t threads=1, size_t capacity=1024*1024): - ThreadPoolBase(name, threads, new queue_t(name, capacity)) + ThreadPoolUsing(const std::string& name, + size_t threads=1, + size_t capacity=1024*1024, + bool auto_shutdown = true): + ThreadPoolBase(name, threads, new queue_t(name, capacity), auto_shutdown) {} ~ThreadPoolUsing() override {} -- cgit v1.2.3 From 2e5b105dffc41695d0a64c5b55eef7c28da49246 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 7 Feb 2024 22:50:28 +0200 Subject: SL-18721 Shutdown fixes #4 --- indra/llcommon/threadpool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/threadpool.h') diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h index fa16c6fe71..b8be7bb81a 100644 --- a/indra/llcommon/threadpool.h +++ b/indra/llcommon/threadpool.h @@ -87,6 +87,7 @@ namespace LL protected: std::unique_ptr mQueue; + std::vector> mThreads; bool mAutomaticShutdown; private: @@ -94,7 +95,6 @@ namespace LL std::string mName; size_t mThreadCount; - std::vector> mThreads; }; /** -- cgit v1.2.3 From 1161262029f9619fb02d81575382b64d82d9cd09 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 15 Mar 2024 00:04:19 +0200 Subject: SL-18721 Restore release behavior Closing window correctly caused a significant amount of logout freezes with no known reproes. Temporarily returning to old behavior were thread was killes without closing window and will reenable in later maints to hopefully get a scenario or at least more data of what is causing the freeze. --- indra/llcommon/threadpool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/threadpool.h') diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h index b8be7bb81a..74056aea17 100644 --- a/indra/llcommon/threadpool.h +++ b/indra/llcommon/threadpool.h @@ -55,7 +55,7 @@ namespace LL * ThreadPool listens for application shutdown messages on the "LLApp" * LLEventPump. Call close() to shut down this ThreadPool early. */ - void close(); + virtual void close(); std::string getName() const { return mName; } size_t getWidth() const { return mThreads.size(); } -- cgit v1.2.3