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

newServer setting maxCheckFailures makes no sense #4198

Merged
merged 2 commits into from Aug 1, 2016

Conversation

Projects
None yet
2 participants
@stutiredboy
Contributor

stutiredboy commented Jul 18, 2016

when dnsdist add newServer with maxCheckFailures parameter, such as maxCheckFailures=3, if the downstream server seems to be down, then the dss->currentCheckFailures will increase 1.

but, if dss->currentCheckFailures not reach the maxCheckFailures value, at this time, the downstream server seems to be up, the dss->currentCheckFailures was not reset to 0.

so when dss->currentCheckFailures reach maxCheckFailures, dnsdist will show downstream down, the change to up in the next second.

dnsdist[24734]: Marking downstream 10.63.49.12:53 as 'down'
dnsdist[24734]: Marking downstream 10.63.49.12:53 as 'up'

In my opinion, discontinuous failure retry makes no sense, so I post this pull request.

Thanks.

@rgacogne rgacogne added the dnsdist label Jul 18, 2016

@rgacogne

This comment has been minimized.

Member

rgacogne commented Jul 18, 2016

Hi,

This change makes sense, thank you! Could you just fix the indentation? I know it's not easy as we still have a mix of tabs and spaces in some places.

@@ -1254,7 +1254,12 @@ void* healthChecksThread()
for(auto& dss : g_dstates.getCopy()) { // this points to the actual shared_ptrs!
if(dss->availability==DownstreamState::Availability::Auto) {
bool newState=upCheck(*dss);
if (!newState && dss->upStatus) {
if (newState) {
if (dss->currentCheckFailures != 0) {

This comment has been minimized.

@rgacogne

rgacogne Jul 18, 2016

Member

You could perhaps skip that test, but that doesn't matter much.

@stutiredboy

This comment has been minimized.

Contributor

stutiredboy commented Jul 19, 2016

rager that. I use space as the indent.

@rgacogne

This comment has been minimized.

Member

rgacogne commented Jul 29, 2016

LGTM

@rgacogne rgacogne merged commit 3075d37 into PowerDNS:master Aug 1, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment