Skip to content

CDRIVER-4207 handshake on new stream in scanner #915

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

Merged
merged 5 commits into from
Dec 17, 2021

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Dec 17, 2021

Summary

Always send the full connection handshake as the first command on a stream in single-threaded monitoring. The bug described in CDRIVER-4207 results in a monitoring command as the first command.

Rejected ideas

I rejected the idea of setting last_failed in mongoc_topology_scanner_node_disconnect. last_failed is used to apply cooldownMS in mongoc_topology_scanner_node_in_cooldown. The Server Monitoring spec does not say that cooldownMS should apply when a network error occurs on an application operation.

@kevinAlbs kevinAlbs marked this pull request as ready for review December 17, 2021 17:03
@kevinAlbs kevinAlbs requested review from jmikola and chardan December 17, 2021 17:03
Copy link
Member

@jmikola jmikola left a comment

Choose a reason for hiding this comment

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

Tested this patch with PHPLIB's test suite (PHPLIB-717) and noted that we no longer receive the following errors throughout:

Failed to get handshake server description: Driver attempted to initialize in load balancing mode, but the server does not support this mode.

Copy link
Contributor

@chardan chardan left a comment

Choose a reason for hiding this comment

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

+1, this looks good! (In my current changes, I'm also having to add more parameters to this function, I'm starting to wonder if it's worth an "options" parameter or something.)

@kevinAlbs kevinAlbs merged commit b42543c into mongodb:master Dec 17, 2021
@kevinAlbs kevinAlbs deleted the handshake_after_error.4207 branch December 17, 2021 21:39
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.

3 participants