Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUST-360 Guard connection establishment by connectTimeoutMS #743

Merged

Conversation

patrickfreed
Copy link
Contributor

In #721, I moved around a lot of the logic for enforcing connectTimeoutMS and inadvertently removed it from the operation connection establishment code path. This PR adds it back in.

@@ -198,16 +197,6 @@ impl Monitor {
// Otherwise, just use connectTimeoutMS.
self.connect_timeout()
};
let timeout_future = async {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was moved into the runtime module.

@patrickfreed patrickfreed marked this pull request as ready for review September 15, 2022 18:35
@patrickfreed patrickfreed requested review from a team and abr-egn and removed request for a team September 15, 2022 18:35
Copy link
Contributor

@abr-egn abr-egn left a comment

Choose a reason for hiding this comment

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

LG! One small comment only.

@@ -59,14 +65,29 @@ impl ConnectionEstablisher {
None
};

let connect_timeout = if let Some(timeout) = options.connect_timeout {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I think this might be easier to read as a match against Some(0), Some(n), and None.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, done. I had to do it a little bit different since we're matching on a Duration, but I still think it's more readable than before.

@patrickfreed patrickfreed merged commit 5fb9b52 into mongodb:main Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants