BUG/MEDIUM: dns: send messages on closed/reused fd if fd was detected broken
authorEmeric Brun <ebrun@haproxy.com>
Thu, 17 Jun 2021 16:23:04 +0000 (18:23 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 18 Jun 2021 08:03:58 +0000 (10:03 +0200)
commit079c609424bf4291c984bfe8d26ba87405493b28
treea9c55377823083eb1d77a51191e2b914a5714851
parentdceef4d9fc5e74964d57a0a772a46fdd7746feff
BUG/MEDIUM: dns: send messages on closed/reused fd if fd was detected broken

This fix complete this incomplete bug fix '(751872e4)':
'BUG/MEDIUM: dns: reset file descriptor if send returns an error

This previous patch detects error on fd and close this one but the code
continues the loop on pending queries and try to send them using the
previously closed fd which could be reused by an other thread.

This patch stop to send queries on this fd and count them on
snd_error counter.

This patch applies on branch 2.3 and all this stuff is already
fixed in newer version by '(d26a6237ad)':
'MEDIUM: resolvers: split resolving and dns message exchange layers'

This patch should be backported on all branches including the previous
fix '(751872e4)':
'BUG/MEDIUM: dns: reset file descriptor if send returns an error'
src/dns.c