Skip to content

#6014 Spread inventory caching better to not hold shutdown as much - #6026

Merged
akleshchev merged 8 commits into
developfrom
andreyk/viewer_6014_2
Jul 21, 2026
Merged

#6014 Spread inventory caching better to not hold shutdown as much#6026
akleshchev merged 8 commits into
developfrom
andreyk/viewer_6014_2

Conversation

@akleshchev

Copy link
Copy Markdown
Contributor
  • Thread gzip packaging
  • Flatten out collection

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in LLInventoryModel::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.

Comment thread indra/newview/llinventorymodel.h Outdated
Comment thread indra/newview/llinventorymodel.cpp Outdated
Comment thread indra/newview/llinventorymodel.cpp
Comment thread indra/newview/llinventorymodel.cpp Outdated
@akleshchev
akleshchev force-pushed the andreyk/viewer_6014_2 branch 2 times, most recently from aa0e913 to db87258 Compare July 20, 2026 19:43
@akleshchev
akleshchev requested a review from Copilot July 20, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Comment thread indra/newview/llinventorymodel.cpp Outdated
Comment thread indra/newview/llinventorymodel.cpp Outdated
@akleshchev akleshchev linked an issue Jul 21, 2026 that may be closed by this pull request
@akleshchev
akleshchev requested a review from Copilot July 21, 2026 14:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, sPendingCacheThreads is 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();

Comment thread indra/newview/skins/default/xui/en/strings.xml Outdated
@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (akleshchev)[https://github.com/akleshchev]
❌ @Copilot
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@akleshchev
akleshchev force-pushed the andreyk/viewer_6014_2 branch from 2802253 to db393c8 Compare July 21, 2026 18:18
@akleshchev
akleshchev merged commit b35e537 into develop Jul 21, 2026
16 of 17 checks passed
@akleshchev
akleshchev deleted the andreyk/viewer_6014_2 branch July 21, 2026 19:42
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize viewer cleanup

5 participants