summaryrefslogtreecommitdiff
path: root/src/mongo/s/service_entry_point_mongos.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/service_entry_point_mongos.cpp')
-rw-r--r--src/mongo/s/service_entry_point_mongos.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mongo/s/service_entry_point_mongos.cpp b/src/mongo/s/service_entry_point_mongos.cpp
index 12ebf1299bd..7c1e38d008c 100644
--- a/src/mongo/s/service_entry_point_mongos.cpp
+++ b/src/mongo/s/service_entry_point_mongos.cpp
@@ -203,9 +203,17 @@ Future<DbResponse> HandleRequest::run() {
}
Future<DbResponse> ServiceEntryPointMongos::handleRequestImpl(OperationContext* opCtx,
- const Message& message) noexcept {
+ const Message& message) try {
auto hr = std::make_shared<HandleRequest>(opCtx, message);
return hr->run();
+} catch (const DBException& ex) {
+ auto status = ex.toStatus();
+ LOGV2(9431602, "Failed to handle request", "error"_attr = redact(status));
+ return status;
+} catch (...) {
+ auto error = exceptionToStatus();
+ LOGV2_FATAL(
+ 9431601, "Request handling produced unhandled exception", "error"_attr = redact(error));
}
Future<DbResponse> ServiceEntryPointMongos::handleRequest(OperationContext* opCtx,
@@ -219,7 +227,7 @@ void ServiceEntryPointMongos::onClientConnect(Client* client) {
}
}
-void ServiceEntryPointMongos::onClientDisconnect(Client* client) {
+void ServiceEntryPointMongos::onClientDisconnect(Client* client) try {
if (load_balancer_support::isFromLoadBalancer(client)) {
_loadBalancedConnections.decrement();
@@ -259,6 +267,11 @@ void ServiceEntryPointMongos::onClientDisconnect(Client* client) {
"aborting in-progress transaction because load-balanced client disconnected"});
}
}
+} catch (const DBException& ex) {
+ LOGV2_DEBUG(8969800,
+ 2,
+ "Encountered error while performing client connection cleanup",
+ "error"_attr = ex.toStatus());
}
void ServiceEntryPointMongos::appendStats(BSONObjBuilder* bob) const {