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

Gracefully handle all exceptions during bootstrap processing #7197

Merged
merged 3 commits into from Dec 14, 2023

Conversation

jbreams
Copy link
Contributor

@jbreams jbreams commented Dec 9, 2023

What, How & Why?

This makes sure we catch exceptions getting thrown during bootstrap application and surface them to the user via the sync error handler. It also fixes one place during session activation where we were not exception-safe which may have caused an uncaught exception to manifest as a REALM_ASSERT(!m_sess) failure rather than a regular uncaught exception.

☑️ ToDos

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

Copy link

coveralls-official bot commented Dec 9, 2023

Pull Request Test Coverage Report for Build jonathan.reams_2983

  • 109 of 120 (90.83%) changed or added relevant lines in 4 files are covered.
  • 39 unchanged lines in 11 files lost coverage.
  • Overall coverage increased (+0.01%) to 91.688%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/realm/sync/noinst/client_impl_base.cpp 5 7 71.43%
src/realm/sync/client.cpp 4 7 57.14%
test/object-store/sync/flx_sync.cpp 98 104 94.23%
Files with Coverage Reduction New Missed Lines %
test/test_index_string.cpp 1 94.13%
src/realm/array_string.cpp 2 88.0%
src/realm/query_expression.hpp 2 93.51%
src/realm/sync/noinst/server/server.cpp 2 76.57%
src/realm/sort_descriptor.cpp 3 93.7%
src/realm/sync/noinst/protocol_codec.hpp 3 76.21%
src/realm/table.cpp 3 90.63%
src/realm/util/file.cpp 3 80.77%
test/test_thread.cpp 3 66.67%
src/realm/sync/noinst/client_impl_base.cpp 5 85.63%
Totals Coverage Status
Change from base Build 1917: 0.01%
Covered Lines: 232255
Relevant Lines: 253310

💛 - Coveralls

@jbreams jbreams force-pushed the jbr/handle_all_exceptions_from_bootstrapping branch from b5f570b to 763ca5b Compare December 13, 2023 04:17
@jbreams jbreams marked this pull request as ready for review December 13, 2023 04:18
check_interrupted_state(realm);
}

auto realm = Realm::get_shared_realm(interrupted_realm_config);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part is the second attempt on applying the bootstrap changes (and it is successful this time). you could consider adding a comment.

Copy link
Collaborator

@danieltabacaru danieltabacaru left a comment

Choose a reason for hiding this comment

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

LGTM

@jbreams jbreams merged commit 5009410 into master Dec 14, 2023
35 checks passed
@jbreams jbreams deleted the jbr/handle_all_exceptions_from_bootstrapping branch December 14, 2023 20:26
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unhandled/unknown exceptions while applying a bootstrap at session start can result in a !m_sess assertion
3 participants