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

add dns host provider lookup timeout #143

Conversation

MKrupauskas
Copy link

@MKrupauskas MKrupauskas commented Jul 24, 2024

Resolves #142 by adding a 3s timeout for DNS lookups. This is better behavior than having the call get stuck indefinitely when the DNS resolver isn't reachable.

Adjusted/added unit tests to verify.

$ go test -run ^TestNewDNSHostProvider$
PASS
ok      github.com/go-zookeeper/zk      0.207s

dnshostprovider.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.60%. Comparing base (6585b41) to head (474e511).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #143      +/-   ##
==========================================
+ Coverage   78.35%   78.60%   +0.25%     
==========================================
  Files           8        8              
  Lines        1349     1365      +16     
==========================================
+ Hits         1057     1073      +16     
  Misses        201      201              
  Partials       91       91              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MKrupauskas MKrupauskas requested a review from jeffbean July 24, 2024 17:39
@jeffbean jeffbean merged commit 27bc0d6 into go-zookeeper:master Jul 24, 2024
9 checks passed
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.

Connect DNS lookups hang indefinitely if there's no response
2 participants