Skip to content

dnsdist: Fix the oustanding counter when an exception is raised #6094

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

Merged

Conversation

rgacogne
Copy link
Member

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.
pdns/dnsdist.cc Outdated
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@rgacogne rgacogne merged commit 309a649 into PowerDNS:master Dec 15, 2017
@rgacogne rgacogne deleted the dnsdist-outstanding-responder-exception branch December 15, 2017 09:39
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
Development

Successfully merging this pull request may close these issues.

dnsdist 1.2.0 - negative values in web gui stats
2 participants