Introduce configurable DNS resolution timeout#1113
Merged
Lorak-mmk merged 4 commits intoscylladb:mainfrom Nov 26, 2025
Merged
Conversation
|
|
wprzytula
requested changes
Oct 30, 2024
a01ba38 to
86e69d8
Compare
Contributor
Author
|
Rebased on main |
8 tasks
86e69d8 to
288e856
Compare
Collaborator
|
Rebased on top of #1487 (which required some changes to the PR), addressed some review comments (but not all yet). |
511dfe4 to
6089ef8
Compare
6089ef8 to
f9eeb14
Compare
Lorak-mmk
added a commit
that referenced
this pull request
Nov 25, 2025
This PR removes unstable-cloud feature, and all related code including tests, examples, CI workflow, and documentation. I also decided to remove InternalKnownNode. It was introduced only because of cloud, and I don't think we'll need that in the future. I did not remove the hierarchy of TLS configurations. I think those make conceptual sense, and we may need them in the future if we introduce some more advanced TLS features (session tickets? More flexible hostname verification?). Why do this now? I want to rebase and update #1113 When this PR was originally made, cloud feature was integrated differently in the code. Updating the PR to current cloud feature structure would require more work, and I don't see the point of spending time on unused feature. ## Pre-review checklist <!-- Make sure you took care of the issues on the list. Put 'x' into those boxes which apply. You can also create the PR now and click on all relevant checkboxes. See CONTRIBUTING.md for more details. --> - [x] I have split my patch into logically separate commits. - [x] All commit messages clearly explain what they change and why. - [ ] ~~I added relevant tests for new features and bug fixes.~~ - [x] All commits compile, pass static checks and pass test. - [x] PR description sums up the changes and reasons why they should be introduced. - [ ] ~~I have provided docstrings for the public items that I want to introduce.~~ - [x] I have adjusted the documentation in `./docs/source/`. - [ ] ~~I added appropriate `Fixes:` annotations to PR description.~~
f9eeb14 to
04181b2
Compare
Collaborator
|
Rebased on main |
wprzytula
reviewed
Nov 25, 2025
This option is responsible for setting the DNS hostname resolution timeout. The default timeout is set to 5 seconds. Co-authored-by: Karol Baryła <karol.baryla@scylladb.com>
…nfig These structs need this context to pass it forward to functions responsible for DNS lookup. Co-authored-by: Karol Baryła <karol.baryla@scylladb.com>
Passed the hostname_resolution_timeout down to the functions responsible for DNS resolution logic. Created a pub(crate) error type to distinguish between errors that can occur during hostname resolution. Notice: it's pub(crate) since the users of this API only emit logs in case of error. The errors are not passed to public API. Created a `lookup_host_with_timeout` function, and extracted some logic here. The purpose is not to introduce complex branching in original function. Co-authored-by: Karol Baryła <karol.baryla@scylladb.com>
Initially I introduced it when trying to adapt DNS timeouts to work with unstable-cloud. After removing unstable-cloud, I thought that it makes sense to keep it in: users can implement their own address translators, and without such variant they have no good way to return custom errors from it (the bad way is to abuse IoError).
04181b2 to
9158ab8
Compare
Collaborator
|
Rebased on main, addressed review comment |
wprzytula
approved these changes
Nov 26, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description by @Lorak-mmk , because I took over this PR from @muzarski .
This PR adds configurable DNS resolution timeout, configurable on
SessionBuilder.Additionally, I added a new variant of
TranslationError-CustomTranslationError. It can be utilized by user-implementedAddressTranslators to return their own error types.It is not connected to this PR, but I added it when trying to make this PR work without removing unstable-cloud feature, and then it was necessary.
I thought it is a nice improvement, so I left it in.
There are no tests in this PR - I don't think we have any infrastructure in place to test DNS in the driver, and introducing it is probably a bigger task.
Fixes: #1033
Pre-review checklist
I added relevant tests for new features and bug fixes.[ ] I have adjusted the documentation in./docs/source/.Fixes:annotations to PR description.