Skip to content

Conversation

@stIncMale
Copy link
Member

@stIncMale stIncMale commented May 27, 2025

This PR is waiting for mongodb/specifications#1805.

JAVA-5880

@stIncMale stIncMale requested a review from katcharov May 27, 2025 21:30
@stIncMale stIncMale self-assigned this May 27, 2025
@stIncMale stIncMale marked this pull request as draft May 27, 2025 21:30
Comment on lines 105 to 114
public void reauthenticate(final InternalConnection connection, final OperationContext operationContext) {
authenticate(connection, connection.getDescription(), operationContext);
authenticate(connection, connection.getDescription(), operationContext.withSessionContext(NoOpSessionContext.INSTANCE));
}

public void reauthenticateAsync(final InternalConnection connection, final OperationContext operationContext,
final SingleResultCallback<Void> callback) {
beginAsync().thenRun((c) -> {
authenticateAsync(connection, connection.getDescription(), operationContext, c);
authenticateAsync(connection, connection.getDescription(), operationContext.withSessionContext(NoOpSessionContext.INSTANCE), c);
}).finish(callback);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OperationContext for the first authentication when we establish a connection comes from MongoClusterImpl.OperationExecutorImpl.getOperationContext, and does not have a SessionContext.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one difference is the use of ReadConcernAwareNoOpSessionContext instead of NoOpSessionContext. I doubt it matters, but I don't remember why that class was needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started using ReadConcernAwareNoOpSessionContext in df84c84 just in case.

@stIncMale stIncMale marked this pull request as ready for review May 28, 2025 16:02
@stIncMale stIncMale requested a review from jyemin May 28, 2025 16:03
Copy link
Collaborator

@jyemin jyemin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and approved for backport as well.

@stIncMale stIncMale merged commit 127318a into mongodb:main Jun 3, 2025
54 checks passed
@stIncMale stIncMale deleted the JAVA-5880 branch June 3, 2025 02:21
stIncMale added a commit to stIncMale/mongo-java-driver that referenced this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants