summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclient.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-04-12 14:24:00 -0400
committerMathias Stearn <mathias@10gen.com>2017-04-27 14:31:25 -0400
commit86aa275a4b9b43d0c647dc0034c6626a95884e18 (patch)
treec5eaa30f81df846855f60399c32e2524a92685a2 /src/mongo/client/dbclient.cpp
parent0bd0382b2bcd0517ce717e7e1d1e57da792c6855 (diff)
downloadmongo-86aa275a4b9b43d0c647dc0034c6626a95884e18.tar.gz
SERVER-28508 OP_MSG in egress and mongod
Diffstat (limited to 'src/mongo/client/dbclient.cpp')
-rw-r--r--src/mongo/client/dbclient.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/client/dbclient.cpp b/src/mongo/client/dbclient.cpp
index 3dc04a3d80b..020a4f23b44 100644
--- a/src/mongo/client/dbclient.cpp
+++ b/src/mongo/client/dbclient.cpp
@@ -178,6 +178,10 @@ rpc::UniqueReply DBClientWithCommands::runCommandWithMetadata(StringData databas
str::stream() << "Database name '" << database << "' is not valid.",
NamespaceString::validDBName(database, NamespaceString::DollarInDbNameBehavior::Allow));
+ // Make sure to reconnect if needed before building our request, since the request depends on
+ // the negotiated protocol which can change due to a reconnect.
+ checkConnection();
+
// call() oddly takes this by pointer, so we need to put it on the stack.
auto host = getServerAddress();