Skip to content

fix(devtools-connect): skip driver ping during connect COMPASS-9455 #557

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nbbeeken
Copy link
Collaborator

@nbbeeken nbbeeken commented Jul 2, 2025

Description

mongodb-js/compass#7083

Set the option that makes the driver not run ping on connect.

This removes some errors that could happen:

  • Ping tests for authentication because it is a command that runs through the connection pool the connection created must be auth-ed
  • The server selected is the primary unless a client-wide read preference was set. This blocks the ping from running until a primary is discovered

This improves some scenarios:

  • No longer is a pool (likely the primary) pre populated with one connection when connect returns
  • Connect returns sooner than RTT to any particular node since it does not wait on monitoring / server selection
    • Nor does connect wait for a MongoDB handshake RTT in addtion to the ping RTT

Open Questions

Does the error timing matter to downstream projects?

Any command can fail auth at anytime, and a primary may not be discoverable at boot but could be when you issue a command. Is "connect time" erroring important?

Checklist

@nbbeeken nbbeeken changed the title fix(devtools-connect): have the driver skip ping during connect COMPASS-9455 fix(devtools-connect): skip driver ping during connect COMPASS-9455 Jul 2, 2025
@coveralls
Copy link

coveralls commented Jul 2, 2025

Coverage Status

coverage: 72.482%. remained the same
when pulling be63343 on COMPASS-9455
into 99fbdb9 on main.

@nbbeeken nbbeeken marked this pull request as ready for review July 2, 2025 20:43
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.

2 participants