summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/async_results_merger.cpp
diff options
context:
space:
mode:
authorMartin Neupauer <martin.neupauer@mongodb.com>2018-11-05 09:39:20 -0500
committerMartin Neupauer <martin.neupauer@mongodb.com>2018-11-09 13:55:19 -0500
commit1c2b3f3ad137758d6cc6275a61841b0836095d6b (patch)
treeaa713aa42b1500f63d22fd9bd59f1fac261b36c2 /src/mongo/s/query/async_results_merger.cpp
parent625e4e2007fe31b9253976eb3815bcfd354a1cf6 (diff)
downloadmongo-1c2b3f3ad137758d6cc6275a61841b0836095d6b.tar.gz
SERVER-37613 Exchange error handling may deliver incorrect error code.
Diffstat (limited to 'src/mongo/s/query/async_results_merger.cpp')
-rw-r--r--src/mongo/s/query/async_results_merger.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/s/query/async_results_merger.cpp b/src/mongo/s/query/async_results_merger.cpp
index cae5f7944a5..685c86affeb 100644
--- a/src/mongo/s/query/async_results_merger.cpp
+++ b/src/mongo/s/query/async_results_merger.cpp
@@ -569,7 +569,12 @@ void AsyncResultsMerger::_cleanUpFailedBatch(WithLock lk, Status status, size_t
remote.status = std::move(status);
// Unreachable host errors are swallowed if the 'allowPartialResults' option is set. We
// remove the unreachable host entirely from consideration by marking it as exhausted.
- if (_params.getAllowPartialResults()) {
+ //
+ // The ExchangePassthrough error code is an internal-only error code used specifically to
+ // communicate that an error has occurred, but some other thread is responsible for returning
+ // the error to the user. In order to avoid polluting the user's error message, we ingore such
+ // errors with the expectation that all outstanding cursors will be closed promptly.
+ if (_params.getAllowPartialResults() || remote.status == ErrorCodes::ExchangePassthrough) {
remote.status = Status::OK();
// Clear the results buffer and cursor id.