Skip to content

#6464 Avoid crashing WaitForResult on a dangling promise - #6471

Open
akleshchev wants to merge 2 commits into
release/26.5from
andreyk/viewer_6441
Open

akleshchev wants to merge 2 commits into
release/26.5from
andreyk/viewer_6441

Conversation

@akleshchev

@akleshchev akleshchev commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Looks like new chat service dies on a (planned) exception before the work it posted via runStorage completes.

I'm not sure if I should be changing WaitForResult to not crash or changing chat service to not block inside a finicky coroutine or both. Blocking is a poor choice for a service that does not control it's own lifetime.

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.

🔵 Needs a closer look

Cross-thread completion after coroutine teardown lacks regression coverage and needs human validation.

1 open issue
What changed in this PR

This PR addresses dangling promises when queued work outlives a waiting coroutine and stops chat-history processing during application errors.

Changes:

  • Share promise ownership with queued callbacks for value and void results.
  • Exit the chat-history manager loop when the application reports an error.
File Description
indra/​newview/​llchatservicehistory.cpp Stops manager processing on application errors.
indra/​llcommon/​workqueue.h Keeps promises alive through queued callback completion.

Review effort: Balanced

Comment thread indra/llcommon/workqueue.h Outdated
@akleshchev
akleshchev marked this pull request as draft October 19, 2026 22:05
@akleshchev

akleshchev commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

I guess I will just not use waitForResult and poll instead.

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.

🟡 Changes recommended

Three unresolved moderate issues affect shutdown safety, object lifetime, and queue-failure handling.

3 open issues

Review effort: Lite

Comment thread indra/newview/llchatservicehistory.cpp
Comment thread indra/newview/llchatservicehistory.cpp 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.

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.

🔵 Needs a closer look

Address storage-operation generation fencing and move the queued callable to avoid copying large work data.

No open issues 🎉

3 resolved since last review

Review effort: Lite

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.

🔵 Needs a closer look

Cross-thread lifetime and logout ordering need human validation, and unnecessary copying of large queued payloads remains unresolved.

1 open issue

Review effort: Balanced

Comment thread indra/newview/llchatservicehistory.cpp
@akleshchev
akleshchev marked this pull request as ready for review October 20, 2026 16:07
akleshchev and others added 2 commits October 20, 2026 19:10
Co-authored-by: akleshchev <117672381+akleshchev@users.noreply.github.com>
@akleshchev
akleshchev requested a review from rohvani October 20, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

4 participants