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

Gracefully handle connection timeouts for registrars that point to non-functional WHOIS servers #15

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

s3cur3
Copy link
Collaborator

@s3cur3 s3cur3 commented Feb 9, 2024

This fixes an issue see with the pairdomains.com registrar, whose WHOIS record terminate with a record that includes this:

    Registrar WHOIS Server: pairdomains.com

The actual WHOIS server for the registrar is whois.pairdomains.com, so prior to this patch, Whois.lookup/1 would fail after 60 seconds with {:error, :timed_out}. Now, we'll fall back to the most recent successfully retrieved record after :connect_timeout (10 seconds by default).

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4e78f29) 91.02% compared to head (60964d0) 91.02%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #15   +/-   ##
=======================================
  Coverage   91.02%   91.02%           
=======================================
  Files           3        3           
  Lines          78       78           
=======================================
  Hits           71       71           
  Misses          7        7           

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

…n-functional WHOIS servers

This fixes an issue see with the `pairdomains.com` registrar, whose WHOIS record terminate with a record that includes this:

```
    Registrar WHOIS Server: pairdomains.com
```

The actual WHOIS server for the registrar is `whois.pairdomains.com`, so prior to this patch, `Whois.lookup/1` would fail after 60 seconds with `{:error, :timed_out}`. Now, we'll fall back to the most recent successfully retrieved record after `:connect_timeout` (10 seconds by default).
@s3cur3 s3cur3 marked this pull request as ready for review February 9, 2024 15:02
@s3cur3 s3cur3 merged commit bba376b into master Feb 9, 2024
18 checks passed
@s3cur3 s3cur3 deleted the connect-timeout branch February 9, 2024 15:02
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