Skip to content

Commit f325224

Browse files
authored
Use OperationContext with NOOP Session (#1733)
JAVA-5880
1 parent a2e0c29 commit f325224

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

driver-core/src/main/com/mongodb/internal/connection/Authenticator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void reauthenticateAsync(final InternalConnection connection, final Opera
113113
}).finish(callback);
114114
}
115115

116-
private static OperationContext operationContextWithoutSession(final OperationContext operationContext) {
116+
static OperationContext operationContextWithoutSession(final OperationContext operationContext) {
117117
return operationContext.withSessionContext(
118118
new ReadConcernAwareNoOpSessionContext(operationContext.getSessionContext().getReadConcern()));
119119
}

driver-core/src/main/com/mongodb/internal/connection/OidcAuthenticator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static OidcCallback getGcpCallback(final MongoCredential credential) {
253253
@Override
254254
public void reauthenticate(final InternalConnection connection, final OperationContext operationContext) {
255255
assertTrue(connection.opened());
256-
authenticationLoop(connection, connection.getDescription(), operationContext);
256+
authenticationLoop(connection, connection.getDescription(), operationContextWithoutSession(operationContext));
257257
}
258258

259259
@Override
@@ -262,7 +262,7 @@ public void reauthenticateAsync(final InternalConnection connection,
262262
final SingleResultCallback<Void> callback) {
263263
beginAsync().thenRun(c -> {
264264
assertTrue(connection.opened());
265-
authenticationLoopAsync(connection, connection.getDescription(), operationContext, c);
265+
authenticationLoopAsync(connection, connection.getDescription(), operationContextWithoutSession(operationContext), c);
266266
}).finish(callback);
267267
}
268268

0 commit comments

Comments
 (0)