summaryrefslogtreecommitdiff
path: root/src/mongo/client
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2021-09-03 19:11:40 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-08 07:54:48 +0000
commitc90f38192378c8526354465991830524eda90c1f (patch)
tree73ce6a76f4dc6f8eaa206309becf5881aaf20a32 /src/mongo/client
parenta0a0d7eecccf38f028a77c4cc8b0f13f8673f675 (diff)
downloadmongo-c90f38192378c8526354465991830524eda90c1f.tar.gz
SERVER-59782 migrate makeGuard calls to ScopeGuard
Diffstat (limited to 'src/mongo/client')
-rw-r--r--src/mongo/client/dbclient_connection.cpp6
-rw-r--r--src/mongo/client/fetcher.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/client/dbclient_connection.cpp b/src/mongo/client/dbclient_connection.cpp
index 9770437645b..48b7977992c 100644
--- a/src/mongo/client/dbclient_connection.cpp
+++ b/src/mongo/client/dbclient_connection.cpp
@@ -704,7 +704,7 @@ DBClientConnection::DBClientConnection(bool _autoReconnect,
void DBClientConnection::say(Message& toSend, bool isRetry, string* actualServer) {
checkConnection();
- auto killSessionOnError = makeGuard([this] { _markFailed(kEndSession); });
+ ScopeGuard killSessionOnError([this] { _markFailed(kEndSession); });
toSend.header().setId(nextMessageId());
toSend.header().setResponseToMsgId(0);
@@ -723,7 +723,7 @@ void DBClientConnection::say(Message& toSend, bool isRetry, string* actualServer
}
Status DBClientConnection::recv(Message& m, int lastRequestId) {
- auto killSessionOnError = makeGuard([this] { _markFailed(kEndSession); });
+ ScopeGuard killSessionOnError([this] { _markFailed(kEndSession); });
auto swm = _session->sourceMessage();
if (!swm.isOK()) {
return swm.getStatus();
@@ -747,7 +747,7 @@ bool DBClientConnection::call(Message& toSend,
bool assertOk,
string* actualServer) {
checkConnection();
- auto killSessionOnError = makeGuard([this] { _markFailed(kEndSession); });
+ ScopeGuard killSessionOnError([this] { _markFailed(kEndSession); });
auto maybeThrow = [&](const auto& errStatus) {
if (assertOk)
uassertStatusOKWithContext(errStatus,
diff --git a/src/mongo/client/fetcher.cpp b/src/mongo/client/fetcher.cpp
index 4dc580c5d12..75cbf7f1d0d 100644
--- a/src/mongo/client/fetcher.cpp
+++ b/src/mongo/client/fetcher.cpp
@@ -339,7 +339,7 @@ Status Fetcher::_scheduleGetMore(const BSONObj& cmdObj) {
void Fetcher::_callback(const RemoteCommandCallbackArgs& rcbd, const char* batchFieldName) {
QueryResponse batchData;
- auto finishCallbackGuard = makeGuard([this, &batchData] {
+ ScopeGuard finishCallbackGuard([this, &batchData] {
if (batchData.cursorId && !batchData.nss.isEmpty()) {
_sendKillCursors(batchData.cursorId, batchData.nss);
}