You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "brumi1024 (via GitHub)" <gi...@apache.org> on 2026/08/25 16:27:30 UTC

Re: [PR] MAPREDUCE-7539. JobHistoryServer API fails to serve aggregated logs due to uuid mismatch [hadoop]

brumi1024 commented on code in PR #8556:
URL: https://github.com/apache/hadoop/pull/8556#discussion_r3855055879


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/LogAggregationIndexedFileController.java:
##########
@@ -237,12 +263,14 @@ public Object run() throws Exception {
     } catch (Exception e) {
       throw new IOException(e);
     }
+    this.writeSession = session;

Review Comment:
   I think this assignment happens too late to make initialization exception-safe. If any filesystem operation throws after session.fsDataOStream is opened, the new session is never assigned to writeSession. AppLogAggregatorImpl will still call closeWriter() from its finally block, but that method can only close the previous session or do nothing. This can leak the output stream and its HDFS lease, leaving a partial file and potentially blocking subsequent aggregation attempts.
   
   Closing session.fsDataOStream directly when initialization fails, and clearing writeSession in closeWriter() after cleanup could solve this.



-- 
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: common-issues-unsubscribe@hadoop.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org