Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not lock destroyed mutex after wait_for_upload timeout #5944

Merged
merged 2 commits into from
Oct 18, 2022

Conversation

jbreams
Copy link
Contributor

@jbreams jbreams commented Oct 17, 2022

What, How & Why?

Changes in #5897 made it so we throw an exception and continue running tests after a call to wait_for_session times out instead of immediately calling std::abort. However, when the sync session becomes inactive and all registered notification callbacks get called with an operation_aborted error code, the callback in wait_for_session attempts to acquire a lock on a mutex that was destroyed when wait_for_session threw and the test suite fails with an uncaught std::system_error.

This change makes it so that the callback is operating on state in a weak_ptr so that if the call to wait_for_session times out and we don't care about getting the callback result anymore, we can just ignore it.

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)
  • C-API, if public C++ API changed.

@cla-bot cla-bot bot added the cla: yes label Oct 17, 2022
@jbreams jbreams requested a review from tgoyne October 18, 2022 15:09
@jbreams jbreams merged commit 0e3d874 into master Oct 18, 2022
@jbreams jbreams deleted the jbr/fix_wait_for_session branch October 18, 2022 16:47
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants