gyfora commented on code in PR #1260:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/1260#discussion_r4720796847


##########
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:
   @rmetzger This doesn't strictly break anything it's just a bad user 
experience, in some cases could be valid but definitely unintended here. So 
hard to capture in a test generally speaking
   
   We can have test coverage but in theory there are 3 cases:
    - You want a new event all the time (materially different message, content 
etc., important to record)
    - One event updated (want to capture something happening every time and how 
many times etc matters)
    - Event once (you want to record something happening, but if it happens 
again doesn't really matter)
   
   There are tests for the event recorder that depending the parameterization 
it works correctly but you need to use the event recorder correctly.
   
   Maybe we should remove the null message key variant, but even then we need 
to add guidelines about constant vs variable keys and their usages/effects.



-- 
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]

Reply via email to