vsantwana commented on code in PR #1194:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1194#discussion_r4426882560
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/KubernetesOperatorConfigOptions.java:
##########
@@ -780,12 +780,12 @@ public static String operatorConfigKey(String key) {
"How often to retrieve Kubernetes cluster resource
usage information. This information is used to avoid running out of cluster
resources when scaling up resources. Negative values disable the feature.");
@Documentation.Section(SECTION_ADVANCED_RECONCILE)
- public static final ConfigOption<Integer>
OPERATOR_EVENT_EXCEPTION_STACKTRACE_LINES =
- operatorConfig("events.exceptions.stacktrace-lines")
+ public static final ConfigOption<Integer>
OPERATOR_EVENT_EXCEPTION_STACKTRACE_MAX_LENGTH =
+ operatorConfig("events.exceptions.stacktrace.max.length")
Review Comment:
To add to this: a negative value is now a regression, not just a missing
guard. Setting `-1` here seems a likely mistake, since nearby options such as
the cluster resource check above treat negative values as "disabled".
With `kubernetes.operator.events.exceptions.stacktrace.max.length: -1`, the
check `stacktrace.length() > maxStackTraceLength` is always true, so
`eventMessage.append(stacktrace, 0, -1)` throws an `IndexOutOfBoundsException`.
`observeJobManagerExceptions` catches it and logs "Failed to fetch JobManager
exception info.", but it then skips `setLastTimestamp`, so the next cycle
retries the same exceptions and fails again. While the job is running, the user
gets no exception events with a stack trace, and a WARN with a stack trace on
every observe cycle. The line-count version did not crash on a negative value.
I checked this with a copy of `testStackTraceTruncationBySizeNotLineCount`
that sets the cap to `-1` and observes twice. Both cycles logged the WARN,
emitted no event, and left the last recorded timestamp unchanged.
Treating `-1` as unlimited, as you suggest, or rejecting negative values
would both fix it.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]