mxm commented on code in PR #575:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/575#discussion_r1179255242


##########
flink-kubernetes-operator-autoscaler/src/main/java/org/apache/flink/kubernetes/operator/autoscaler/metrics/ScalingMetrics.java:
##########
@@ -83,6 +83,8 @@ public static void computeDataRateMetrics(
             scalingMetrics.put(ScalingMetric.CURRENT_PROCESSING_RATE, 
numRecordsInPerSecond);
         } else {
             LOG.error("Cannot compute true processing rate without 
numRecordsInPerSecond");
+            scalingMetrics.put(ScalingMetric.TRUE_PROCESSING_RATE, Double.NaN);
+            scalingMetrics.put(ScalingMetric.CURRENT_PROCESSING_RATE, 
Double.NaN);

Review Comment:
   Unrelated change? Why is this necessary?



##########
flink-kubernetes-operator-autoscaler/src/main/java/org/apache/flink/kubernetes/operator/autoscaler/JobAutoScalerImpl.java:
##########
@@ -113,7 +115,13 @@ public boolean scale(FlinkResourceContext<? extends 
AbstractFlinkResource<?, ?>>
                     scalingExecutor.scaleResource(resource, autoScalerInfo, 
conf, evaluatedMetrics);
             autoScalerInfo.replaceInKubernetes(kubernetesClient);
             return specAdjusted;
-        } catch (Exception e) {
+        } catch (Throwable e) {
+            eventRecorder.triggerEvent(
+                    resource,
+                    EventRecorder.Type.Warning,
+                    EventRecorder.Reason.AutoscalerError,
+                    EventRecorder.Component.Operator,
+                    e.getMessage());
             LOG.error("Error while scaling resource", e);

Review Comment:
   Can we log before triggering the event just in case...



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