Skip to content

Conversation

@rgacogne
Copy link
Member

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.

This might help with #4344.

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.
@rgacogne rgacogne merged commit 38f67e9 into PowerDNS:master Aug 29, 2016
@rgacogne rgacogne deleted the dnsdist-outstanding-race branch August 29, 2016 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant