Shopify / Shopify/app_profiler
`AppProfiler::Server` instances leak with reforking enabled
Open
@casperisfine is already working on this.
Since Sep 24, 2023.
- Dominant language
- Ruby
- Stars
- 268
- Forks
- 14
- Avg merge
- 1h 9m
- Merged PRs (30d)
- 1
Description
I've noticed some File Descriptor growth in molds on pods with reforking enabled:
Using a heap dump and harb I was able to map it to AppProfiler::Server:
harb> rootpath 0x7f7d2327a568
root path to 0x7f7d2327a568:
ROOT (end_proc)
0x7f7d23279c30 (DATA: proc)
0x7f7cecb3f658 (OBJECT: AppProfiler::Server::ProfileServer)
0x7f7d2327a7e8 (OBJECT: AppProfiler::Server::ProfileServer::UNIX)
0x7f7d2327a568 (FILE: (null))
harb> rootpath 0x7f7cb1171c88
root path to 0x7f7cb1171c88:
ROOT (end_proc)
0x7f7cb1171670 (DATA: proc)
0x7f7d22654608 (OBJECT: AppProfiler::Server::ProfileServer)
0x7f7cb1171e18 (OBJECT: AppProfiler::Server::ProfileServer::UNIX)
0x7f7cb1171c88 (FILE: (null))
(showing only two instances here, but there is about one per generation.
I suspect the server need to be explicitly closed after fork.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.