]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Reset origFD asap to keep the outstanding count correct 4365/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 25 Aug 2016 15:15:54 +0000 (17:15 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 25 Aug 2016 15:15:54 +0000 (17:15 +0200)
commit51642fe3c362edf8b4ad4f9c470d5569d781c78b
tree1e6203e2ead62a73b59eedb7643053453cfa1095
parent4f18781a43c3734855a00f5aded03255250ba6d9
dnsdist: Reset origFD asap to keep the outstanding count correct

Previously the health check thread waited until we had finished
with the IDState to set `origFD` to -1, but:
* for the UDP client thread, the only difference it makes is that
`outstanding` will not be incremented if `origFD` is not -1,
which is not what we want since we are going to decrement it
* for the UDP responder thread, it actually increases the
likelihood of decrementing `outstanding` twice, once in the
responder threader and once in the health check thread.

This was especially likely to be an issue because the health check
thread used to call `gettime()` and to acquire a mutex before
setting `origFD` to -1.
pdns/dnsdist.cc