#6014 Spread inventory caching better to not hold shutdown as much - #6026
Conversation
akleshchev
commented
Jul 20, 2026
- Thread gzip packaging
- Flatten out collection
7f5ed46 to
1fcc72b
Compare
There was a problem hiding this comment.
Pull request overview
This PR adjusts inventory cache shutdown behavior by moving gzip compression work off the main thread and revising how inventory descendants are collected for caching, aiming to reduce shutdown stalls.
Changes:
- Launch gzip compression for inventory cache output on background threads and add a shutdown-time wait to join pending compression threads.
- Replace
collectDescendentsIf()usage inLLInventoryModel::cache()with a manual traversal/collection pass. - Add profiling scopes for inventory cleanup and caching paths.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| indra/newview/llinventorymodel.h | Adds a shutdown wait API and static tracking for async cache compression threads. |
| indra/newview/llinventorymodel.cpp | Implements async gzip compression, new descendant collection logic, and thread-join shutdown behavior. |
| indra/newview/llappviewer.cpp | Ensures shutdown waits for pending async inventory cache compression to complete. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aa0e913 to
db87258
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
indra/newview/llinventorymodel.cpp:2497
- waitForPendingCacheWrites() declares LLTimer wait_timer but never uses it (likely to trigger an unused-variable warning under -Werror). Also, sPendingCacheThreads is never cleared after joining, so the vector can grow across multiple cache() calls and will remain non-empty even after all threads are joined.
LL_DEBUGS(LOG_INV) << "Waiting for " << sPendingCacheThreads.size()
<< " inventory cache compression thread(s) to complete..." << LL_ENDL;
LLTimer wait_timer;
for (auto& thread : sPendingCacheThreads)
{
if (thread.joinable())
{
thread.join();
}
}
LL_INFOS(LOG_INV) << "Inventory cache compression completed" << LL_ENDL;
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
indra/newview/llinventorymodel.cpp:2498
LLTimer wait_timer;is never used, which can trigger an unused-variable warning (often fatal under -Werror). Either remove it or log the elapsed time.
LLTimer wait_timer;
indra/newview/llinventorymodel.cpp:2504
- After joining,
sPendingCacheThreadsis left populated with non-joinable threads. This makes the "Waiting for N" message inaccurate on later calls and allows the vector to grow across multiple cache() operations; clear it after joining.
for (auto& thread : sPendingCacheThreads)
{
if (thread.joinable())
{
thread.join();
a68cd15 to
7017e3c
Compare
|
I have read the CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the CLA. |
2802253 to
db393c8
Compare