-
Notifications
You must be signed in to change notification settings - Fork 1.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
[Bug]: Invalid order of -XX properties in KAFKA_JVM_PERFORMANCE_OPTS variable #8579
Comments
IIRC, ordered maps are not supported by YAML / CRDs. So I think this might not be possible. Have you tried directly defining the environment variable using the |
That is indeed a good point, I forgot about possible issues with the ordering inside the resulting k8s manifest itself. But anyway, was able to get it running with proposed use spec:
template:
connectContainer:
env:
- name: JAVA_TOOL_OPTIONS
value: -XX:+UnlockDiagnosticVMOptions |
Triaged on 1.6.2023: It might help to use LinkedHashMap on our side instead of HashMap. It has to be investigated if this really helps or if the ordering breaks even before (e.g. in Kubernetes). If that does not help, API changes would be the only option. |
The |
Ok, so I guess we can re-triage it next week with this new information. I will update the labels. |
One solution that came to my mind is to apply sorting of XX arguments in ModelUtils#jvmPerformanceOptions method. The sorting can be based on a set of "prioritized" parameters like |
My understanding is that the options might differ for different versions and JDKs - and likely their dependencies as well. So I wonder if hardcoding such logic might break it for users who use other JDKs. But it would be an option to consider. |
Triaged on 15/06/2023: We should investigate ensuring that |
I created PR with my proposal of hardcoded priority list used for sorting. |
Added ParallelParameterizedTest with dependency to junit-jupiter-params Signed-off-by: Jakub Malek <[email protected]>
Signed-off-by: Jakub Malek <[email protected]>
Signed-off-by: Jakub Malek <[email protected]>
…imzi#8579) Removed ParallelParameterizedTest annotation along with junit-jupiter-params dependency Signed-off-by: Jakub Malek <[email protected]>
Signed-off-by: Jakub Malek <[email protected]> Signed-off-by: Jakub Małek <[email protected]> Co-authored-by: Federico Valeri <[email protected]>
Bug Description
The ordering of JVM performance options is not guaranteed, due use of unordered
Map<String, String>
in JvmOptions class.As a consequence following configuration:
can result in JVM startup failure when JVM flags are misordered:
java -XX:+PrintNMTStatistics -XX:+UnlockDiagnosticVMOptions
Steps to reproduce
Configure
jvmOptions
with to enableUnlockDiagnosticVMOptions
andPrintNMTStatistics
flags.Expected behavior
The ordering of performance options should guaranteed.
Strimzi version
0.31.1
Kubernetes version
1.24.9
Installation method
Helm chart
Infrastructure
Azure
Configuration files and logs
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: