gyfora commented on code in PR #1260:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1260#discussion_r4718572806
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/observer/JobStatusObserver.java:
##########
@@ -207,11 +232,29 @@ protected void
observeJobManagerExceptions(FlinkResourceContext<R> ctx) {
}
}
+ private void reportExceptionHistoryTooLarge(
+ FlinkResourceContext<R> ctx, MemorySize maxResponseSize) {
+ // A JobException event would mark the exceptions up to its time as
reported after an
+ // operator restart
+ eventRecorder.triggerEventOnce(
+ ctx.getResource(),
+ EventRecorder.Type.Warning,
+ EventRecorder.Reason.JobExceptionHistoryTooLarge,
+ String.format(
+ "The exception history of the job is larger than %s,
the smaller of %s and %s, so its exceptions are not reported.",
+ maxResponseSize,
+
KubernetesOperatorConfigOptions.OPERATOR_EVENT_EXCEPTION_MAX_RESPONSE_SIZE
+ .key(),
+ RestOptions.CLIENT_MAX_CONTENT_LENGTH.key()),
+ EventRecorder.Component.Job,
+ null,
Review Comment:
This event should have a key, otherwise it will be reported in every
reconciliation round as a new event.
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/KubernetesOperatorConfigOptions.java:
##########
@@ -800,13 +800,28 @@ public static String operatorConfigKey(String key) {
.withDescription(
"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_MAX_LENGTH =
+ operatorConfig("events.exceptions.stacktrace.max.length")
+ .intType()
+ .defaultValue(2048)
+ .withDescription(
+ "Maximum number of characters of exception text to
include in Kubernetes event messages: the stack trace of JobException events
and the message of the Error event for a failed job. The text is truncated by
size, regardless of how many lines it spans. Negative values disable the
limit.");
+
+ /**
+ * @deprecated Use {@link
#OPERATOR_EVENT_EXCEPTION_STACKTRACE_MAX_LENGTH}; a line limit does
+ * not bound a single line of any size.
+ */
+ @Deprecated
Review Comment:
We should remove this in the next release. Please open a follow up ticket
for 1.18
--
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]