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

fix: awaitable isMaster timeout must respect connectTimeoutMS #2627

Merged
merged 19 commits into from
Dec 1, 2020

Conversation

emadum
Copy link
Contributor

@emadum emadum commented Nov 19, 2020

This PR ensures that awaitable isMaster handshakes respect an unlimited timeout (connectionTimeoutMS=0) as per the SDAM specification section on socket timeouts:

Clients MUST use connectTimeoutMS as the timeout for the connection handshake. When connectTimeoutMS=0, the timeout is unlimited and MUST remain unlimited for awaitable isMaster replies. Otherwise, connectTimeoutMS is non-zero and clients MUST use connectTimeoutMS + heartbeatFrequencyMS as the timeout for awaitable isMaster replies.

NODE-2874

@emadum emadum changed the title test: reproduce NODE-2874 fix: monitor socket timeout should be unlimited when connectTimeoutMS=0 Nov 19, 2020
@emadum emadum changed the title fix: monitor socket timeout should be unlimited when connectTimeoutMS=0 fix: make monitor socket timeout unlimited when connectTimeoutMS=0 Nov 19, 2020
emadum and others added 5 commits November 19, 2020 13:13
When the legacy ReplSet and Server topology types are destroyed
they transition their internal state after a potentially long async
close process has completed. With the recently introduced infinite
default socket timeout, we are hitting this race condition more
consistently. This patch ensures the types transition their state
immediately, reducing the chance that such race conditions can
occur.

NODE-2916
@emadum emadum marked this pull request as ready for review November 28, 2020 23:36
@emadum emadum changed the title fix: make monitor socket timeout unlimited when connectTimeoutMS=0 fix: awaitable isMaster timeout must respect connectTimeoutMS Nov 30, 2020
@emadum emadum requested a review from mbroadst December 1, 2020 01:20
Copy link
Member

@mbroadst mbroadst left a comment

Choose a reason for hiding this comment

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

LGTM

@emadum emadum merged commit b365c50 into 3.6 Dec 1, 2020
@emadum emadum deleted the NODE-2874/fix-monitor-timeout branch December 1, 2020 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants