diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2015-11-18 11:19:55 -0500 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2015-11-18 13:16:38 -0500 |
commit | d91511f1616ba5f72a6ae74dae9f49a690430952 (patch) | |
tree | bcc4ad4e49844ade948267220d7c0f96bd44d618 /src/mongo/executor | |
parent | 9adaeed3b24fe9e847515c1406ce16eb325a17b5 (diff) | |
download | mongo-d91511f1616ba5f72a6ae74dae9f49a690430952.tar.gz |
SERVER-21504 NetworkInterfaceASIO logging tweaks
- move "connection failed" log messages to log level 1
- make sure we log commands that failed due to cancellation
Diffstat (limited to 'src/mongo/executor')
-rw-r--r-- | src/mongo/executor/network_interface_asio_command.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/mongo/executor/network_interface_asio_command.cpp b/src/mongo/executor/network_interface_asio_command.cpp index 5c2a02e5a28..9e21021d70e 100644 --- a/src/mongo/executor/network_interface_asio_command.cpp +++ b/src/mongo/executor/network_interface_asio_command.cpp @@ -279,9 +279,18 @@ void NetworkInterfaceASIO::_completeOperation(AsyncOp* op, const ResponseStatus& } if (op->_inSetup) { + // If we are in setup we should only be here if we failed to connect. + invariant(!resp.isOK()); // If we fail during connection, we won't be able to access any of our members after calling // op->finish(). - log() << "Failed to connect to " << op->request().target << " - " << resp.getStatus(); + LOG(1) << "Failed to connect to " << op->request().target << " - " << resp.getStatus(); + } + + if (!resp.isOK()) { + // In the case that resp is not OK, but _inSetup is false, we are using a connection that + // we got from the pool to execute a command, but it failed for some reason. + LOG(2) << "Failed to execute command: " << op->request().toString() + << " reason: " << resp.getStatus(); } op->finish(resp); @@ -302,11 +311,6 @@ void NetworkInterfaceASIO::_completeOperation(AsyncOp* op, const ResponseStatus& _inProgress.erase(iter); } - if (!resp.isOK()) { - LOG(2) << "Failed to execute command: " << op->request().toString() - << " reason: " << resp.getStatus(); - } - invariant(ownedOp); auto conn = std::move(op->_connectionPoolHandle); |