[SERVER-65946] Provide better diagnostics for `DBClient::call` Created: 25/Apr/22  Updated: 29/Oct/23  Resolved: 06/Jul/22

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Jason Chan
Resolution: Fixed Votes: 0
Labels: servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split to SERVER-65997 Add diagnostics to `DBClientConnectio... Closed
Problem/Incident
Related
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2022-07-11
Participants:
Linked BF Score: 49

 Description   

The current implementation for DBClientConnection::call could absorb exceptions and return a boolean to indicate failures:

auto maybeThrow = [&](const auto& errStatus) {
    if (assertOk)
        uassertStatusOKWithContext(errStatus, str::stream() << "dbclient error communicating with server " << getServerAddress());
    return false;
};

This essentially hides the real cause of failure and makes root-causing failures difficult. We should make such failures visible by either:

  • Changing call to always return a Status.
  • Changing call to always throw exceptions.

Looking at the code, there are not many invocations of call, and we should be able to change the interface to always throw with few changes to the call-sites.



 Comments   
Comment by Githook User [ 06/Jul/22 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com', 'username': 'jasonjhchan'}

Message: SERVER-65946 Have DBClient::call always throw exceptions on failure
Branch: master
https://github.com/mongodb/mongo/commit/5451a539fd4e469c66b35a263a169aaa485604a5

Generated at Thu Feb 08 06:04:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.