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

Add a configuration to enable a debug faulthandler (PP-1717) #2065

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

jonathangreen
Copy link
Member

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 every INTERVAL 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?

  • Tested locally, I was using it to help track down a deadlock in PG.

Checklist

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@jonathangreen jonathangreen requested a review from a team September 17, 2024 13:25
Copy link
Contributor

@tdilauro tdilauro left a comment

Choose a reason for hiding this comment

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

🪵👀

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.79%. Comparing base (fee4a3d) to head (25bce2c).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2065      +/-   ##
==========================================
+ Coverage   90.70%   90.79%   +0.08%     
==========================================
  Files         343      344       +1     
  Lines       40584    40598      +14     
  Branches     6588     8794    +2206     
==========================================
+ Hits        36813    36859      +46     
+ Misses       2501     2484      -17     
+ Partials     1270     1255      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jonathangreen jonathangreen merged commit 0c59101 into main Sep 17, 2024
20 checks passed
@jonathangreen jonathangreen deleted the chore/faulthandler-config branch September 17, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants