Skip to content

Commit

Permalink
YARN-3476. Nodemanager can fail to delete local logs if log aggregati…
Browse files Browse the repository at this point in the history
…on fails. Contributed by Rohith
  • Loading branch information
jlowe committed May 8, 2015
1 parent 30099a3 commit 25e2b02
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions hadoop-yarn-project/CHANGES.txt
Expand Up @@ -433,6 +433,9 @@ Release 2.7.1 - UNRELEASED
YARN-3554. Default value for maximum nodemanager connect wait time is too
high (Naganarasimha G R via jlowe)

YARN-3476. Nodemanager can fail to delete local logs if log aggregation
fails (Rohith via jlowe)

Release 2.7.0 - 2015-04-20

INCOMPATIBLE CHANGES
Expand Down
Expand Up @@ -417,6 +417,11 @@ public Object run() throws Exception {
public void run() {
try {
doAppLogAggregation();
} catch (Exception e) {
// do post clean up of log directories on any exception
LOG.error("Error occured while aggregating the log for the application "
+ appId, e);
doAppLogAggregationPostCleanUp();
} finally {
if (!this.appAggregationFinished.get()) {
LOG.warn("Aggregation did not complete for application " + appId);
Expand Down Expand Up @@ -454,6 +459,15 @@ private void doAppLogAggregation() {
// App is finished, upload the container logs.
uploadLogsForContainers(true);

doAppLogAggregationPostCleanUp();

this.dispatcher.getEventHandler().handle(
new ApplicationEvent(this.appId,
ApplicationEventType.APPLICATION_LOG_HANDLING_FINISHED));
this.appAggregationFinished.set(true);
}

private void doAppLogAggregationPostCleanUp() {
// Remove the local app-log-dirs
List<Path> localAppLogDirs = new ArrayList<Path>();
for (String rootLogDir : dirsHandler.getLogDirsForCleanup()) {
Expand All @@ -474,11 +488,6 @@ private void doAppLogAggregation() {
this.delService.delete(this.userUgi.getShortUserName(), null,
localAppLogDirs.toArray(new Path[localAppLogDirs.size()]));
}

this.dispatcher.getEventHandler().handle(
new ApplicationEvent(this.appId,
ApplicationEventType.APPLICATION_LOG_HANDLING_FINISHED));
this.appAggregationFinished.set(true);
}

private Path getRemoteNodeTmpLogFileForApp() {
Expand Down

0 comments on commit 25e2b02

Please sign in to comment.