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: Fix several bugs in the TCP code path, add unit tests #10108
Conversation
Nice to see more general TCP FastOpen support. I'm a bit worried about the source binding changes as you are relying on specific functions. Both alternatives are not generally available. |
Thinking about this a bit more, the old-fashioned way of binding to a source address before connect should still work, right? |
Yes, that only concerns source interface selection, sorry! |
Something to investigate: I did not have The fallback to |
Fixed the detection of |
Nice, when this is merged, I'll make a PR to change the two write calls in sdig into as single one. |
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.
FastOpen works now as expected in sdig. I do see two writes in captures, but that is expected. I browsed the rest of the changes, and found nothing surprising.
We need to be careful about the client going away (closes the connection, for example) while we are sending queued responses.
2fda1df
to
d65fdf0
Compare
Rebased to fix some commits not compiling. |
Short description
This PR fixes several issues in corner cases, introduced during the refactoring for out-of-order support. It also adds a lot of unit tests for that TCP code, which was planned for 1.7.0 but fast-forwarded because of issues reported with 1.6.0-alpha1.
It also adds a new configuration option,
setTCPInternalPipeBufferSize
, that can be used to set the size of the buffer of the internal pipe used to pass queries to TCP worker threads, thus allowing a smoother handling of incoming TCP connections peaks.The diff seems huge but most of that (3200 out of 3900 additions) comes from the new unit tests, which actually amount to more lines of code than the TCP code itself and provides a very nice code coverage (which unfortunately does not prevent bugs from still hiding in a unexpected state.. ;-)).
One caveat is that this drops source selection support other than via
SO_BINDTODEVICE
, because having to pass the source interface name and index down to the actualsendmsg
code is very annoying. Perhaps we should at least look into supportingIP_SENDIF
in addition toSO_BINDTODEVICE
?Checklist
I have: