Skip to content
New issue

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

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

Already on GitHub? # to your account

Increase connection timeouts to allow using Atlas shared clusters #3206

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Nov 13, 2024

I wasted far too much time trying to run the tests using an Atlas M0 cluster. It turned out that the error was due to a delay too short to allow the connection.

@GromNaN GromNaN requested a review from a team as a code owner November 13, 2024 16:41
@GromNaN GromNaN requested a review from alcaeus November 13, 2024 16:41
'connectTimeoutMS' => 100,
'serverSelectionTimeoutMS' => 250,
'connectTimeoutMS' => 1000,
'serverSelectionTimeoutMS' => 1000,
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest using a slightly higher value here, as it's intended to outlast a replica set election. Replica Set Elections still notes that an election should not exceed 12 seconds, but I think you'd be OK to just throw another zero on this and use 10. If that's still too much, I'd at least consider bumping it to 5 or 6 seconds.

But using the same value as connectTimeoutMS may send the wrong message to any users that come across this. The connection timeout should logically be a smaller value.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok. I've set serverSelectionTimeoutMS to 6000ms.

@GromNaN GromNaN requested review from jmikola and removed request for alcaeus November 14, 2024 10:06
@GromNaN GromNaN merged commit 4b91f77 into mongodb:5.1 Nov 14, 2024
27 checks passed
@GromNaN GromNaN deleted the test-timeout branch November 14, 2024 20:19
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants