pltbkd commented on code in PR #22291:
URL: https://github.com/apache/flink/pull/22291#discussion_r1159523718


##########
flink-runtime/src/main/java/org/apache/flink/runtime/source/coordinator/SourceCoordinator.java:
##########
@@ -178,9 +178,16 @@ void announceCombinedWatermark() {
                                     
aggregator.getAggregatedWatermark().getTimestamp());
                         });
 
-        long maxAllowedWatermark =
-                globalCombinedWatermark.getTimestamp()
-                        + 
watermarkAlignmentParams.getMaxAllowedWatermarkDrift();
+        long maxAllowedWatermark;
+        try {
+            maxAllowedWatermark =

Review Comment:
   nit: maybe we can check with 
`Long.MAX_VALUE-globalCombinedWatermark.getTimestamp() >= 
watermarkAlignmentParams.getMaxAllowedWatermarkDrift()`, instead of using the 
try-catch? 
   Or maybe it's better to add a comment explaining why an ArithmeticException 
can be thrown here.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to