Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

cmd/waypoint-entrypoint: dump heap profile on SIGUSR1 #1194

Merged
merged 1 commit into from
Mar 16, 2021
Merged

Conversation

mitchellh
Copy link
Contributor

This adds functionality to dump a heap profile (in pprof format) when the entrypoint receives a SIGUSR1. The profile is written to the system temporary directory with a timestamp. The exact path that was dumped is logged.

I hope to use this to debug #1192 and any future issues.

In the future, the team mentioned it'd be really cool if the server can request this information from an entrypoint and we can potentially use that to debug weird deployments. I think that's a good idea, but this is a simple thing we can do now and backport safely so I'm opening this PR first.

@mitchellh mitchellh requested a review from evanphx March 12, 2021 20:59
Copy link
Member

@briancain briancain left a comment

Choose a reason for hiding this comment

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

🐛 🔍

@mitchellh
Copy link
Contributor Author

This helped us find a leak so I will merge this for now until we improve it one day later.

@mitchellh mitchellh merged commit 3adb29b into main Mar 16, 2021
@mitchellh mitchellh deleted the ceb-debug branch March 16, 2021 16:27
mitchellh added a commit that referenced this pull request Mar 16, 2021
cmd/waypoint-entrypoint: dump heap profile on SIGUSR1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants