diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-18 17:02:53 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-18 17:02:53 -0300 |
| commit | 959575a5ca598bf5f37fb5cebe7ed1d80d3d71f7 (patch) | |
| tree | acc8d60aedb12b70048e676e8a7349deb0010db8 /src/mongo/executor/network_interface_tl.cpp | |
| parent | 76588293975fc059cf076779e4283e6ffaf8afff (diff) | |
New upstream version 6.0.20upstream
Diffstat (limited to 'src/mongo/executor/network_interface_tl.cpp')
| -rw-r--r-- | src/mongo/executor/network_interface_tl.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/mongo/executor/network_interface_tl.cpp b/src/mongo/executor/network_interface_tl.cpp index 0f23b2f61d7..9d7a4129ca1 100644 --- a/src/mongo/executor/network_interface_tl.cpp +++ b/src/mongo/executor/network_interface_tl.cpp @@ -1021,10 +1021,15 @@ void NetworkInterfaceTL::ExhaustCommandState::continueExhaustRequest( } auto onAnyResponse = RemoteCommandOnAnyResponse(requestState->host, response); - if (!catchingInvoke([&] { doMetadataHook(onAnyResponse); }, - [&](Status& err) { finalResponsePromise.setError(err); }, - "Exhaust command metadata hook readReplyMetadata")) + try { + doMetadataHook(onAnyResponse); + } catch (const DBException& ex) { + Status err = ex.toStatus(); + LOGV2( + 9183100, "Exhaust command metadata hook readReplyMetadata failed", "error"_attr = err); + finalResponsePromise.setError(err); return; + } // If the command failed, we will call 'onReply' as a part of the future chain paired with // the promise. This is to be sure that all error paths will run 'onReply' only once upon @@ -1037,20 +1042,28 @@ void NetworkInterfaceTL::ExhaustCommandState::continueExhaustRequest( return; } - if (!catchingInvoke([&] { onReplyFn(onAnyResponse); }, - [&](Status& err) { finalResponsePromise.setError(err); }, - "Exhaust command onReplyFn")) + try { + onReplyFn(onAnyResponse); + } catch (const DBException& ex) { + Status err = ex.toStatus(); + LOGV2(9183101, "Exhaust command onReplyFn failed", "error"_attr = err); + finalResponsePromise.setError(err); return; + } // Reset the stopwatch to measure the correct duration for the following reply stopwatch.restart(); if (deadline != kNoExpirationDate) { deadline = stopwatch.start() + requestOnAny.timeout; } - if (!catchingInvoke([&] { setTimer(); }, - [&](Status& err) { finalResponsePromise.setError(err); }, - "Exhaust command setTimer")) + try { + setTimer(); + } catch (const DBException& ex) { + Status err = ex.toStatus(); + LOGV2(9183102, "Exhaust command setTimer failed", "error"_attr = err); + finalResponsePromise.setError(err); return; + } requestState->getClient(requestState->conn) ->awaitExhaustCommand(baton) |
