Skip to content
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

dnsdist: Reset origFD asap to keep the outstanding count correct #4365

Merged
merged 1 commit into from Aug 29, 2016

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.

None yet

1 participant