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

Log thread backtraces and GC stats for app debugging #33027

Merged
merged 2 commits into from Feb 7, 2020
Merged

Conversation

wjordan
Copy link
Contributor

@wjordan wjordan commented Feb 6, 2020

Description

Three changes in this PR:

  1. Update our Puma fork to the latest upstream version (4.3.1), with a slightly different approach to request-balancing and some extra debugging hooks for thread backtrace and gc stats;
  2. Add a plugin (LogAppStats) to log app stats every second across all worker processes for debugging purposes, that can be dynamically switched on/off by a flag.
  3. Add before_fork code to (re-)launch DCDO and Gatekeeper update-threads in the parent. This fixes a bug where DCDO/Gatekeeper entries were not getting updated in the daemonized parent process in cluster (workers > 0) + daemon (-d) mode.

Testing Story

Manual testing on an adhoc to confirm the logging and dynamic configuration work as expected. No automated testing at this point since the instrumentation was developed quickly, and intended to be enabled only for temporary/debugging purposes.

Copy link

@uponthesun uponthesun left a comment

Choose a reason for hiding this comment

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

Code changes look fine to me, but is it necessary to combine the instrumentation changes with pulling in the upstream Puma updates? The latter carries extra potential for risk / unexpected changes that might confound our investigation, doesn't it?

If it is reasonable to decouple the two my preference would be to deploy the instrumentation changes first and record the results before deploying the Puma updates.

@wjordan
Copy link
Contributor Author

wjordan commented Feb 7, 2020

Good point @uponthesun - I've separated out the version update from the instrumentation and updated the PR- here is the updated diff.

Copy link

@uponthesun uponthesun left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! Cool to see how this works.

@wjordan wjordan merged commit b842d53 into staging Feb 7, 2020
@wjordan wjordan deleted the log_app_stats branch February 7, 2020 19:51
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.

None yet

2 participants