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: Use a counter to mark IDState usage instead of the FD #8154

Merged
merged 3 commits into from Aug 7, 2019

Conversation

rgacogne
Copy link
Member

@rgacogne rgacogne commented Aug 2, 2019

Short description

This change fixes a possible ABA issue and, coupled with stronger checks when updating the state, should reduce the likelihood of any issue when a state is reused from a different thread.

Needs a serious review.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

@rgacogne
Copy link
Member Author

rgacogne commented Aug 5, 2019

Travis failures are unrelated (network issues, apparently).

Copy link
Member

@chbruyand chbruyand left a comment

Choose a reason for hiding this comment

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

LGTM!

int origFD = ids.origFD;
if(origFD >=0 && ids.age++ > g_udpTimeout) {
/* We set origFD to -1 as soon as possible
int64_t usageIndicator = ids.usageIndicator;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe use .load() ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't that equivalent? Or do you think the use of .load() more readable, perhaps?

Copy link
Member

@chbruyand chbruyand Aug 6, 2019

Choose a reason for hiding this comment

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

It is. That was just to match https://github.com/PowerDNS/pdns/pull/8154/files#diff-41f3f8b6ff377ad8fb04d1a7a307a50eR547
(I'm fine without .load() anyway)

@rgacogne rgacogne merged commit 63c9e5e into PowerDNS:master Aug 7, 2019
@rgacogne rgacogne deleted the dnsdist-outstanding-reset branch August 7, 2019 07:21
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.

None yet

2 participants