You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "navina (via GitHub)" <gi...@apache.org> on 2023/05/17 17:59:46 UTC

[GitHub] [pinot] navina commented on a diff in pull request #10773: Add decoder initialization error to the server's error cache

navina commented on code in PR #10773:
URL: https://github.com/apache/pinot/pull/10773#discussion_r1196883043


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/LLRealtimeSegmentDataManager.java:
##########
@@ -1419,8 +1419,15 @@ public LLRealtimeSegmentDataManager(SegmentZKMetadata segmentZKMetadata, TableCo
 
     // Create message decoder
     Set<String> fieldsToRead = IngestionUtils.getFieldsForRecordExtractor(_tableConfig.getIngestionConfig(), _schema);
-    StreamMessageDecoder streamMessageDecoder = StreamDecoderProvider.create(_partitionLevelStreamConfig, fieldsToRead);
-    _streamDataDecoder = new StreamDataDecoderImpl(streamMessageDecoder);
+    try {
+      StreamMessageDecoder streamMessageDecoder =
+          StreamDecoderProvider.create(_partitionLevelStreamConfig, fieldsToRead);
+      _streamDataDecoder = new StreamDataDecoderImpl(streamMessageDecoder);
+    } catch (Exception e) {
+      _realtimeTableDataManager.addSegmentError(_segmentNameStr,
+          new SegmentErrorInfo(now(), "Failed to initialize the StreamMessageDecoder", e));

Review Comment:
   Yeah I know what you mean. This class requires a lot of rework.
   
   > there are other _segmentLogger.error or thrown error in this method, don't we also need to call _realtimeTableDataManager.addSegmentError to those as well?
   
   Yeah. I think I can add one more segment error in the last try-catch block in the constructor.  
   
    > if the comment above make sense, should we do something similar to PartitionConsumer consume loop and call the _realtimeTableDataManager.addSegmentError at the very end as a catch all?
   
   The partition consumer thread already adds to the segment error cache. 



-- 
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: commits-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org