Add a configuration to enable a debug faulthandler (PP-1717) #2065
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.
Description
Adds a new env variable
PALACE_LOG_DEBUG_TRACEBACK_INTERVAL
. This option is disabled when it is zero (the default). When it is non-zero it uses the python faulthandler module to print stack traces of every thread to stderr everyINTERVAL
seconds.Motivation and Context
This is useful to figure out the state of the app when a thread is deadlocked, watching the stack traces after the deadlock occurs gives an idea of what is happening. I though this would be useful to add to the main codebase as it might help assist if / when we get deadlocks happening in environments that are not easily reproduced. This could be enabled with a env var to get a bit of additional information to assist with debugging.
How Has This Been Tested?
Checklist