You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "harris233 (via GitHub)" <gi...@apache.org> on 2023/05/30 14:26:46 UTC
[GitHub] [hudi] harris233 commented on a diff in pull request #8839: Fix Memory Leak in RealtimeCompactedRecordReader
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:

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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org