Skip to content

[9.18] Pin the dns_dispatch to threads when reusing

Ondřej Surý requested to merge 3766-pin-TCP-dispatch-to-threads-v9_18 into v9_18

Previously, dns_dispatch_gettcp() could pick a TCP connection created by different thread - this breaks our contractual promise to DNS dispatch by using the TCP connection on a different thread than it was created. Add .tid member to the dns_dispatch_t struct and skip the dispatches from other threads when looking up a TCP dispatch that we can reuse in dns_request.

NOTE: This is going to be properly refactored, but this change could be also backported to 9.18 for better stability and thread-affinity.

(cherry picked from commit 1a999353)

Closes #3766 (closed)

Backport of MR !7299 (merged)

Edited by Ondřej Surý

Merge request reports