summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWaley Chen <waleycz@gmail.com>2016-03-07 11:30:52 -0500
committerRamon Fernandez <ramon@mongodb.com>2016-03-29 17:37:01 -0400
commit36b4c60e7ccc96e3c05479136d264109d61a5339 (patch)
tree59d3c5342f31226a559d36136b0da377c4074f02 /src
parentaa87323a825af440fe431ae82b1fc37adfd20e2c (diff)
downloadmongo-36b4c60e7ccc96e3c05479136d264109d61a5339.tar.gz
SERVER-22767 mongos segfault when invoking .explain() on certain operations
(cherry picked from commit cfa10de6e60b4eb0fbaa39d8d5e3a3774ad47b95)
Diffstat (limited to 'src')
-rw-r--r--src/mongo/client/parallel.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/client/parallel.cpp b/src/mongo/client/parallel.cpp
index 661156340bc..37de2506e0f 100644
--- a/src/mongo/client/parallel.cpp
+++ b/src/mongo/client/parallel.cpp
@@ -857,8 +857,14 @@ void ParallelSortClusteredCursor::finishInit(OperationContext* txn) {
}
throw;
} else {
- warning() << "db exception when finishing on " << shardId
- << ", current connection state is " << mdata.toBSON() << causedBy(e);
+ // the InvalidBSON exception indicates that the BSON is malformed ->
+ // don't print/call "mdata.toBSON()" to avoid unexpected errors e.g. a segfault
+ if (e.getCode() == 22)
+ warning() << "bson is malformed :: db exception when finishing on " << shardId
+ << causedBy(e);
+ else
+ warning() << "db exception when finishing on " << shardId
+ << ", current connection state is " << mdata.toBSON() << causedBy(e);
mdata.errored = true;
throw;
}