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: Fix the oustanding counter when an exception is raised #6094

Merged

Conversation

@rgacogne
Copy link
Member

@rgacogne rgacogne commented Dec 14, 2017

Short description

If an exception is raised in the responder thread after the outstanding queries counter has been decremented, but before we could mark the state as processed, the same state would be processed again and the counter decremented a second time, either because of a duplicate answer or more likely by the timeout handler.
This commit simply increase back the outstanding counter when such an exception occurs. It might fixes #5652.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled and tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
If an exception is raised in the responder thread after the outstanding
queries counter has been decremented, but before we could mark the
state as processed, the same state would be processed again and the
counter decremented a second time, either because of a duplicate
answer or more likely by the timeout handler.
This commit simply increase back the outstanding counter when such
an exception occurs.
@rgacogne rgacogne added this to the dnsdist-1.3.0 milestone Dec 14, 2017
if (outstandingDecreased) {
/* so an exception was raised after we decreased the outstanding queries counter,
but before we could set ids->origFD to -1 (because we also set outstandingDecreased
to false then), meaning the IDS still considered active and we will decrease the

This comment has been minimized.

@zeha

zeha Dec 14, 2017
Collaborator

... the IDS still ... add is before still

@rgacogne rgacogne merged commit 309a649 into PowerDNS:master Dec 15, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@rgacogne rgacogne deleted the rgacogne:dnsdist-outstanding-responder-exception branch Dec 15, 2017
rgacogne added a commit to rgacogne/pdns that referenced this pull request Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.