harris233 commented on code in PR #8839:
URL: https://github.com/apache/hudi/pull/8839#discussion_r1210365944


##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/realtime/HoodieRealtimeRecordReader.java:
##########
@@ -69,8 +69,18 @@ private static RecordReader<NullWritable, ArrayWritable> 
constructRecordReader(R
       LOG.info("Enabling merged reading of realtime records for split " + 
split);
       return new RealtimeCompactedRecordReader(split, jobConf, realReader);
     } catch (IOException ex) {
-      LOG.error("Got exception when constructing record reader", ex);
+      LOG.error("Got IOException when constructing record reader", ex);
       throw new HoodieException(ex);
+    } catch (Exception e) {
+      LOG.error("Got exception when constructing record reader", e);
+      try {
+        if (null != realReader) {

Review Comment:
   
![image](https://github.com/apache/hudi/assets/48636225/8351358d-20ae-4fc9-ac1d-c11499168e30)
  
   If we put it in finally block, realReader will be closed when creating 
record reader correctly and getting next result will be affected. I think we 
only need to close it when constructing record reader failed. @danny0405 



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