Improved logging when plugins are cancelled for taking too long#323
Open
yrro wants to merge 18 commits intofreeipa:masterfrom
Open
Improved logging when plugins are cancelled for taking too long#323yrro wants to merge 18 commits intofreeipa:masterfrom
yrro wants to merge 18 commits intofreeipa:masterfrom
Conversation
Fixes: freeipa#322 Signed-off-by: Sam Morris <sam@robots.org.uk>
2fc63e6 to
e82e074
Compare
…e timeout mechanism itself from failures caused by healthcheck plugins catching the TimeoutException and returning its own failures
Collaborator
|
Thanks for the patch. I'll try to review it soon. |
Collaborator
|
I don't think including a traceback is necessary when a timeout occurs. I think this would lead to confusion in users thinking that this is a code issue and not merely a timeout. If it is persistent then users can debug logging to identify where it is timing out. I set timeout=1 and ran --source ipahealthcheck.ipa.certs and the tracebacks don't really tell what is going on other than reads are failing (which isn't the root cause of the issue). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With these changes, it's a lot more obvious when reported errors are caused by a health check timeout.
One other significant change: when a plugin is interrupted by a timeout, a
CRITICALresult is returned with the keyhealthcheck_timeout.TimeoutExceptionand does not throw anything, thehealthcheck_timeoutresult is still returned - previously there would be no failures raised by the pluginTimeoutExceptionand raises its own exception, there will now be two failures returned, because the plugin caller can't know if an exception thrown by a plugin was really caused by aTimeoutException(well, perhaps it could if it examined the exception chain, that part of Python is a bit new to me, and it relies on the plugin code chaining the exception it throws to theTimeoutExceptionit caught).Fixes: #322