Copilot commented on code in PR #17563:
URL: https://github.com/apache/pinot/pull/17563#discussion_r2720987349


##########
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/FreshnessBasedConsumptionStatusChecker.java:
##########
@@ -78,11 +78,18 @@ protected boolean isSegmentCaughtUp(String segmentName, 
RealtimeSegmentDataManag
     // the stream consumer to check partition count if we're already caught up.
     StreamPartitionMsgOffset currentOffset = 
rtSegmentDataManager.getCurrentOffset();
 
-    StreamMetadataProvider streamMetadataProvider =
-        
realtimeTableDataManager.getStreamMetadataProvider(rtSegmentDataManager);
-    StreamPartitionMsgOffset latestStreamOffset =
-        
RealtimeSegmentMetadataUtils.fetchLatestStreamOffset(rtSegmentDataManager, 
streamMetadataProvider);
+    StreamPartitionMsgOffset latestStreamOffset = null;
+    try {
+      StreamMetadataProvider streamMetadataProvider =
+          
realtimeTableDataManager.getStreamMetadataProvider(rtSegmentDataManager);
+      latestStreamOffset =
+          
RealtimeSegmentMetadataUtils.fetchLatestStreamOffset(rtSegmentDataManager, 
streamMetadataProvider);
+    } catch (Exception e) {

Review Comment:
   Catching generic `Exception` is too broad. Consider catching specific 
exceptions like `TimeoutException` that are expected, and let unexpected 
exceptions propagate. This prevents masking serious errors while still handling 
known failure cases.
   ```suggestion
       } catch (RuntimeException e) {
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to