From 1c2b3f3ad137758d6cc6275a61841b0836095d6b Mon Sep 17 00:00:00 2001 From: Martin Neupauer Date: Mon, 5 Nov 2018 09:39:20 -0500 Subject: SERVER-37613 Exchange error handling may deliver incorrect error code. --- src/mongo/s/query/async_results_merger.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mongo/s/query/async_results_merger.cpp') 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. -- cgit v1.2.1