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

RUBY-1933 Add debug level logging around initial DNS seed list query #2904

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

jamis
Copy link
Contributor

@jamis jamis commented Oct 25, 2024

When a mongodb+srv URI is parsed, it attempts to resolve the hostname and fetch the DNS records associated with it. This occurs synchronously, which can cause the application to seem to pause at that point if there is any delay in fetching the DNS records. That pause can be difficult to troubleshot, because no logging was done to indicate that the DNS records were being queried.

This PR adds a debug line just before fetching the DNS records for the given hostname, which will hopefully add some transparency when debugging network issues.

NOTE: This PR also refactors some of the constructor for Mongo::Client. I initially considered adding the logging there, and so did the refactoring in preparation, but later decided to log closer to the actual issue. As the refactoring was also an improvement, I opted to leave it, though it was ultimately unrelated to this change.

@jamis jamis requested a review from comandeo-mongo October 25, 2024 21:37
@jamis jamis requested review from comandeo-mongo and removed request for comandeo-mongo November 4, 2024 19:50
@jamis jamis merged commit 1924187 into mongodb:master Nov 5, 2024
258 checks passed
@jamis jamis deleted the 1933-dns-logging branch November 5, 2024 15:53
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