-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[CLI] Workaround to set a custom heap snapshot dir #170756
Conversation
56d429c
to
3f87c31
Compare
Pinging @elastic/kibana-core (Team:Core) |
Pinging @elastic/kibana-operations (Team:Operations) |
@watson are you planning on picking up the Node 20 PR in the near future? It looks mostly ready? |
I haven't had time due to serverless work. If someone wants to take it over I'll happily do hand over. Or I can probably find time this month. |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
To update your PR or re-run it, just comment with: |
Summary
When Kibana is running inside a Docker container, the root filesystem is read-only. If we try to use
--heapsnapshot-signal=SIGUSR2
in theNODE_OPTIONS
and then send this signal to the Kibana process, the process crashes with an error complaining about the read-only filesystem.The
--diagnostic-dir
parameter is supposed to set the destination folder for the heap snapshots, but there is a bug in Node <20 (nodejs/node#39493).Since Kibana is running under non-root user, there is no way to work this around with
mount --bind
. And apparently, the Node 20 upgrade is not going to happen shortly (#162696). Due to those facts, the easiest option would be to use thewriteHeapSnapshot()
call.The proposed workaround takes place only if both options
--heapsnapshot-signal
and--diagnostic-dir
are present at the same time, and can be safely removed right in #162696.Checklist