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

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

Conversation

pieterlexis
Copy link
Contributor

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
Copy link
Contributor

Nice! Fixes the biggest complaint in #4312

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

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

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) {
Copy link
Member

Choose a reason for hiding this comment

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

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.

This change logs every minute if the maintenance function throws an
exception.
@pieterlexis pieterlexis force-pushed the dnsdist-no-shutdown-on-maintenance-error branch from e1bf476 to 5f3ea71 Compare November 1, 2016 11:23
@rgacogne rgacogne merged commit a1821a7 into PowerDNS:master Nov 9, 2016
@pieterlexis pieterlexis deleted the dnsdist-no-shutdown-on-maintenance-error branch November 9, 2016 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants