You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by "dukelion (via GitHub)" <gi...@apache.org> on 2026/05/29 10:16:27 UTC
[PR] ZOOKEEPER-2837: Do not pass server JVM flags to status diagnostic client [zookeeper]
dukelion opened a new pull request, #2398:
URL: https://github.com/apache/zookeeper/pull/2398
**Problem**
`zkServer.sh status` runs `FourLetterWordMain` — a short-lived diagnostic client — but passes it the full merged JVM flags (`${flags[@]}`), which include `SERVER_JVMFLAGS`.
When `SERVER_JVMFLAGS` contains large heap or preallocation settings such as:
```bash
-Xmx8G -XX:+AlwaysPreTouch
```
every `status` check forks a process that reserves and touches the full server heap. With monitoring tools that call `status` frequently, this causes:
- **Severe RSS spikes** — each status process briefly allocates the full server heap
- **Memory pressure** — monitoring can consume tens of gigabytes of memory churn per minute
- **GC log spam** (original ZOOKEEPER-2837 symptom) — if GC logging is configured in `SERVER_JVMFLAGS`, every status check creates a new GC log file
**Root Cause**
`${flags[@]}` is the merged result of `JVMFLAGS` + `SERVER_JVMFLAGS`. The `status` command passes both `${clientflags[@]}` and `${flags[@]}` to `FourLetterWordMain`, but `FourLetterWordMain` is a client utility and should only receive `CLIENT_JVMFLAGS`.
**Fix**
Remove `"${flags[@]}"` from the `status` command invocation. `FourLetterWordMain` now only receives `"${clientflags[@]}"`.
This is a simpler and more targeted fix than the `START_SERVER_JVMFLAGS` approach proposed in PR #302, which was rejected for adding unnecessary complexity.
**References**
- [ZOOKEEPER-2837](https://issues.apache.org/jira/browse/ZOOKEEPER-2837) — Previously closed as "Won't Fix" because the proposed `START_SERVER_JVMFLAGS` solution was overly complex. This PR provides a minimal alternative that addresses the same underlying bug.
- PR #302 — The earlier rejected attempt to fix this issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] ZOOKEEPER-5109: Do not pass server JVM flags to status diagnostic client [zookeeper]
Posted by "kezhuw (via GitHub)" <gi...@apache.org>.
kezhuw commented on PR #2398:
URL: https://github.com/apache/zookeeper/pull/2398#issuecomment-6306994886
@dukelion Merged. Thank you for your contribution! Do you have an apache jira account so I can assign [ZOOKEEPER-5109](https://issues.apache.org/jira/browse/ZOOKEEPER-5109) to you ? You can request one if not.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] ZOOKEEPER-5109: Do not pass server JVM flags to status diagnostic client [zookeeper]
Posted by "kezhuw (via GitHub)" <gi...@apache.org>.
kezhuw commented on PR #2398:
URL: https://github.com/apache/zookeeper/pull/2398#issuecomment-6405993369
Welcome! Assigned ZOOKEEPER-5109 to you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] ZOOKEEPER-5109: Do not pass server JVM flags to status diagnostic client [zookeeper]
Posted by "kezhuw (via GitHub)" <gi...@apache.org>.
kezhuw merged PR #2398:
URL: https://github.com/apache/zookeeper/pull/2398
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] ZOOKEEPER-5109: Do not pass server JVM flags to status diagnostic client [zookeeper]
Posted by "dukelion (via GitHub)" <gi...@apache.org>.
dukelion commented on PR #2398:
URL: https://github.com/apache/zookeeper/pull/2398#issuecomment-6372967039
thank you!
I've just registered as `vasilii` on ASF jira.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org