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

RCORE-2187 Prefix sync connection log messages with co_id when possible #7849

Merged
merged 8 commits into from
Jul 25, 2024

Conversation

jbreams
Copy link
Contributor

@jbreams jbreams commented Jun 27, 2024

What, How & Why?

This updates the logger used by sync Connections/Sessions to be prefixed with the app services co_id rather than the numeric conn ident counter when available. This lets us more easily correlate client logs to server logs. If the co_id is not available the behavior should be unchanged.

☑️ 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 Jun 27, 2024

Pull Request Test Coverage Report for Build jonathan.reams_3347

Details

  • 48 of 48 (100.0%) changed or added relevant lines in 4 files are covered.
  • 212 unchanged lines in 16 files lost coverage.
  • Overall coverage decreased (-0.003%) to 90.955%

Files with Coverage Reduction New Missed Lines %
test/fuzz_tester.hpp 1 57.73%
test/test_index_string.cpp 1 93.48%
test/test_util_network_ssl.cpp 1 89.59%
test/util/crypt_key.cpp 1 75.0%
src/realm/sync/noinst/client_impl_base.cpp 2 82.33%
test/object-store/util/test_file.cpp 2 86.29%
test/test_lang_bind_helper.cpp 2 93.2%
src/realm/sync/noinst/protocol_codec.hpp 3 73.54%
src/realm/sync/noinst/server/server.cpp 5 73.41%
test/test_sync.cpp 5 92.9%
Totals Coverage Status
Change from base Build 2443: -0.003%
Covered Lines: 214712
Relevant Lines: 236064

💛 - Coveralls

Copy link

coveralls-official bot commented Jul 11, 2024

Pull Request Test Coverage Report for Build jonathan.reams_3367

Details

  • 83 of 83 (100.0%) changed or added relevant lines in 6 files are covered.
  • 53 unchanged lines in 13 files lost coverage.
  • Overall coverage increased (+0.02%) to 91.1%

Files with Coverage Reduction New Missed Lines %
src/realm/array_string.cpp 1 88.03%
src/realm/query_expression.hpp 1 93.81%
src/realm/sync/network/websocket.cpp 1 72.2%
test/test_util_network.cpp 1 95.56%
src/realm/mixed.cpp 2 86.46%
src/realm/sync/transform.cpp 2 61.05%
test/object-store/sync/flx_sync.cpp 2 98.32%
test/test_index_string.cpp 2 93.41%
src/realm/bplustree.cpp 6 72.55%
src/realm/sync/noinst/client_impl_base.cpp 6 82.46%
Totals Coverage Status
Change from base Build 2517: 0.02%
Covered Lines: 216400
Relevant Lines: 237540

💛 - Coveralls

logger.base_logger = make_logger(m_ident, m_appservices_coid, get_client().logger.base_logger);

for (auto& [ident, sess] : m_sessions) {
sess->logger.base_logger = Session::make_logger(ident, logger.base_logger);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess it's not possible that a session may be logging something at the same time right?

@jbreams
Copy link
Contributor Author

jbreams commented Jul 24, 2024

@kmorkos, any thoughts here?

Copy link
Contributor

@kmorkos kmorkos left a comment

Choose a reason for hiding this comment

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

oops, missed this request before. lgtm! :shipit:

@jbreams
Copy link
Contributor Author

jbreams commented Jul 24, 2024

@danieltabacaru , can you take another quick look at the test I added?

@jbreams jbreams merged commit 0020893 into master Jul 25, 2024
41 checks passed
@jbreams jbreams deleted the jbr/coid_logging branch July 25, 2024 15:27
@github-actions github-actions bot mentioned this pull request Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants