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
Stream reuse #283
Stream reuse #283
Conversation
This is for upstream pipes and using them again for the next query. Signposted code for reuse_tcp structure in outside_network.h
…stination find spare id value in reused connection.
fix that comm_point_start_listening does not close the same fd that is started.
fix debug output of reuse tcp and test leak of process
add comm_point indicator for write events for reuse stream writes.
remove pkt args from outnet_tcp_take_into_use, use w.pkt.
Resolved comm_point_start_listening conflict for socket close.
Ready to merge? |
The branch is ready for use, it is waiting for review(s), before merge. |
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.
Looks good to me also!
I have a question and some nits.
What is the benefit of MAX_REUSE_TCP_QUERIES
?
The nits:
- Shouldn't
log_reuse_tcp(<number>, ...)
turn tolog_reuse_tcp(<level>, ...)
and
verbose(<number>, ...)
turn toverbose(<level>, ...)
? Unless they are for dev debugging and will be removed? - The
ssl_reuse.tdir
and thessl_reuse.*
files therein could be renamed to tls_reuse.
The |
Hi. A my personal note, if I have correctly understood, the connection timeout of reuse is hard-coded to 30 seconds. |
Sure, increased the reuse time to 60 seconds in 6b97cb1 . |
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.
Thanks for incorporating the feedback, looks good to me!
- Merge PR #283 : Stream reuse. This implements upstream stream reuse for performing several queries over the same TCP or TLS channel.
Unbound 1.12.0 with patch from #283 and
|
The fix is in commit 0502ab3 . Thanks for the report! |
* nlnet/master: - Fix missing prototypes in the code. Changelog note for NLnetLabs#373 - Merge PR NLnetLabs#373 from fobser: Warning: arithmetic on a pointer to void is a GNU extension. Changelog note for NLnetLabs#335 - Merge PR NLnetLabs#335 from fobser: Sprinkle in some static to prevent missing prototype warnings. Warning: arithmetic on a pointer to void is a GNU extension. - Fix to squelch permission denied and other errors from remote host, they are logged at higher verbosity but not on low verbosity. - Fix NLnetLabs#371: unbound-control timeout when Unbound is not running. - iana portlist updated. - make depend. Code repo continues for 1.13.1 in development. - Fix update, with write event check with streamreuse and fastopen. - Fix for NLnetLabs#283: fix stream reuse and tcp fast open. - Fix on windows to ignore connection failure on UDP, unless verbose. - Fix unbound-dnstap-socket to not use log routine from interrupt handler and not print so frequently when invoked in sequence. - Fix NLnetLabs#356: deadlock when listening tcp. - Fix NLnetLabs#360: for the additionally reported TCP Fast Open makes TCP connections fail, in that case we print a hint that this is happening with the error in the logs. Sprinkle in some static to prevent missing prototype warnings.
This implements stream reuse towards Unbound's upstream servers. When a query is sent to a server for which there is an open socket, the socket is reused without opening a new stream to the server. For TCP and TLS queries, for IPv4 and IPv6. Sockets are opened per-thread, since the per-thread worker keeps track of the reused sockets.