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

Don't exit dnsdist on an exception in maintenance #4640

Merged
merged 1 commit into from Nov 9, 2016

Conversation

Projects
None yet
3 participants
@pieterlexis
Member

pieterlexis commented Oct 26, 2016

Short description

dnsdist would exit if an exception was thrown in the maintenance function.

This change logs every minute if the maintenance function throws an exception.

Checklist

I have:

@phonedph1

This comment has been minimized.

Contributor

phonedph1 commented Oct 26, 2016

Nice! Fixes the biggest complaint in #4312

infolog("Error during execution of maintenance function: %s", e.what());
secondsToWaitLog = 61;
}
--secondsToWaitLog;

This comment has been minimized.

@rgacogne

rgacogne Oct 27, 2016

Member

This should probably be decremented by interval instead of one, in case we decide to make the interval duration configurable.

This comment has been minimized.

@pieterlexis

pieterlexis Oct 27, 2016

Member

we might amend the assignment of secondsToWaitLog to that configuration setting. as the decrement then still happens every second?

This comment has been minimized.

@rgacogne

rgacogne Oct 27, 2016

Member

If interval is not guaranteed to be equal to 1 anymore, the decrement won't happen every second except if we alter the code to do so. This would probably be needed to keep the cache cleaning delay consistent anyhow.

(*f)();
secondsToWaitLog = 0;
}
catch(LuaContext::ExecutionErrorException &e) {

This comment has been minimized.

@rgacogne

rgacogne Oct 27, 2016

Member

Perhaps we could catch std::runtime_error, or even std::exception instead of LuaContext::ExecutionErrorException? Because otherwise we don't catch LuaContext::SyntaxErrorException nor LuaContext::WrongTypeException for example, although I'm not sure they can be raised in that context.

Don't exit dnsdist on an exception in maintenance
This change logs every minute if the maintenance function throws an
exception.

@pieterlexis pieterlexis force-pushed the pieterlexis:dnsdist-no-shutdown-on-maintenance-error branch from e1bf476 to 5f3ea71 Nov 1, 2016

@rgacogne rgacogne merged commit a1821a7 into PowerDNS:master Nov 9, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@pieterlexis pieterlexis deleted the pieterlexis:dnsdist-no-shutdown-on-maintenance-error branch Nov 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment