-
Notifications
You must be signed in to change notification settings - Fork 916
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
dnsdist: Implement async processing of queries and responses #12388
Conversation
d72a142
to
80188a2
Compare
I might have missed it, but are |
You did not miss it, I did not add that part of the documentation yet but I will do that soon! |
Done so now, thanks :-) |
Rebased to fix conflicts. |
Rebased to fix (new) conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Started with reading the docs, notes a few things.
To be continued.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some local nits noted. Still have to try to grasp the whole thing.
@@ -69,6 +73,7 @@ struct DNSQuestion | |||
DNSQuestion(const DNSQuestion&) = delete; | |||
DNSQuestion& operator=(const DNSQuestion&) = delete; | |||
DNSQuestion(DNSQuestion&&) = default; | |||
virtual ~DNSQuestion() = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this virtual dt needed? Only once class derives from DNSQuestion
and it does not override the dt (and adds no fields either). Though I see it will make dnsdist_ffi_dnsresponse_set_async
more complicated, as it wants to distinguish the two one way or another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not sure how we would get a DNSResponse
pointer from a DNSQuestion
pointer otherwise? We could use a union and a boolean in dnsdist_ffi_dnsquestion_t
to store the correct type of pointer instead, of course, but it would impact all the existing FFI methods.
I pushed a few commits addressing your remarks, thanks! |
There is still something fishy going on on OpenBSD
investigating... Added a check on negatve timeout in
Looks like the default value -1 of timeout in BTW earlier I suggested to use
in misc.cc (with a funny |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit and and a bug, described in comments.
When we have a bigger problem than this PR, because mplexer.hh documents -1 as 'will wait forever', and this is the behaviour I want, not being woken up every second for no reason.. I guess it has always been broken with |
|
Nice, thank you! I pushed that change now. |
Tests OK now on both macOS and OpenBSD. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot say I checked every detail, but this reads good now and after the latest changes I've run tests on macOS, OpenBSD and debian bullseye successfully
Short description
This PR implements the ability to process queries and responses in an asynchronous way, suspending them to continue processing other queries and responses, while we are waiting for an external event to occur.
It also implements the ability to restart a query based on the content of the response, for example to re-try sending the initial query to a different pool of servers if the initial attempts yields a
ServFail
orRefused
response code.The documentation needs to be updated before merging this PR.Note that this pull request builds on #12383 and will have to be rebased.Closes #10690
Checklist
I have: