Return-Path: X-Original-To: apmail-hadoop-yarn-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-yarn-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A1B55181E5 for ; Thu, 28 May 2015 01:54:17 +0000 (UTC) Received: (qmail 87786 invoked by uid 500); 28 May 2015 01:54:17 -0000 Delivered-To: apmail-hadoop-yarn-issues-archive@hadoop.apache.org Received: (qmail 87733 invoked by uid 500); 28 May 2015 01:54:17 -0000 Mailing-List: contact yarn-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: yarn-issues@hadoop.apache.org Delivered-To: mailing list yarn-issues@hadoop.apache.org Received: (qmail 87721 invoked by uid 99); 28 May 2015 01:54:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2015 01:54:17 +0000 Date: Thu, 28 May 2015 01:54:17 +0000 (UTC) From: "zhihai xu (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (YARN-3727) For better error recovery, check if the directory exists before using it for localization. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/YARN-3727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] zhihai xu updated YARN-3727: ---------------------------- Description: For better error recovery, check if the directory exists before using it for localization. We saw the following localization failure happened due to existing cache directories. {code} 2015-05-11 18:59:59,756 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ResourceLocalizationService: DEBUG: FAILED { hdfs://XXXX/XXXXX/libjars/1234.jar, 1431395961545, FILE, null }, Rename cannot overwrite non empty destination directory /XXXX/8/yarn/nm/usercache/XXXX/filecache/21637 2015-05-11 18:59:59,756 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalizedResource: Resource hdfs://XXXX/XXXXX/libjars/1234.jar(->/XXXX/8/yarn/nm/usercache/XXXX/filecache/21637/1234.jar) transitioned from DOWNLOADING to FAILED {code} The real cause for this failure may be disk failure, LevelDB operation failure for {{startResourceLocalization}}/{{finishResourceLocalization}} or others. I wonder whether we can add error recovery code to avoid the localization failure by not using the existing cache directories for localization. The exception happened at {{files.rename(dst_work, destDirPath, Rename.OVERWRITE)}} in FSDownload#call. Based on the following code, after the exception, the existing cache directory used by {{LocalizedResource}} will be deleted. {code} try { ......... files.rename(dst_work, destDirPath, Rename.OVERWRITE); } catch (Exception e) { try { files.delete(destDirPath, true); } catch (IOException ignore) { } throw e; } finally { {code} Since the conflicting local directory will be deleted after localization failure, I think it will be better to check if the directory exists before using it for localization to avoid the localization failure. was: For better error recovery, check if the directory exists before using it for localization. We saw the following localization failure happened due to existing cache directories. {code} 2015-05-11 18:59:59,756 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ResourceLocalizationService: DEBUG: FAILED { hdfs://XXXX/XXXXX/libjars/1234.jar, 1431395961545, FILE, null }, Rename cannot overwrite non empty destination directory /XXXX/8/yarn/nm/usercache/XXXX/filecache/21637 2015-05-11 18:59:59,756 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalizedResource: Resource hdfs://XXXX/XXXXX/libjars/1234.jar(->/XXXX/8/yarn/nm/usercache/XXXX/filecache/21637/1234.jar) transitioned from DOWNLOADING to FAILED {code} The real cause for this failure may be disk failure, LevelDB operation failure for {{startResourceLocalization}}/{{finishResourceLocalization}} or others. I wonder whether we can add error recovery code to avoid the localization failure by not using the existing cache directories for localization. The exception happened at {{files.rename(dst_work, destDirPath, Rename.OVERWRITE)}} in FSDownload#call. Based on the following code, after the exception, the existing cache directory used by {{LocalizedResource}} will be deleted. {{code}} try { ......... files.rename(dst_work, destDirPath, Rename.OVERWRITE); } catch (Exception e) { try { files.delete(destDirPath, true); } catch (IOException ignore) { } throw e; } finally { {{code}} Since the conflicting local directory will be deleted after localization failure, I think it will be better to check if the directory exists before using it for localization to avoid the localization failure. > For better error recovery, check if the directory exists before using it for localization. > ------------------------------------------------------------------------------------------ > > Key: YARN-3727 > URL: https://issues.apache.org/jira/browse/YARN-3727 > Project: Hadoop YARN > Issue Type: Improvement > Components: nodemanager > Affects Versions: 2.7.0 > Reporter: zhihai xu > Assignee: zhihai xu > > For better error recovery, check if the directory exists before using it for localization. > We saw the following localization failure happened due to existing cache directories. > {code} > 2015-05-11 18:59:59,756 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ResourceLocalizationService: DEBUG: FAILED { hdfs://XXXX/XXXXX/libjars/1234.jar, 1431395961545, FILE, null }, Rename cannot overwrite non empty destination directory /XXXX/8/yarn/nm/usercache/XXXX/filecache/21637 > 2015-05-11 18:59:59,756 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalizedResource: Resource hdfs://XXXX/XXXXX/libjars/1234.jar(->/XXXX/8/yarn/nm/usercache/XXXX/filecache/21637/1234.jar) transitioned from DOWNLOADING to FAILED > {code} > The real cause for this failure may be disk failure, LevelDB operation failure for {{startResourceLocalization}}/{{finishResourceLocalization}} or others. > I wonder whether we can add error recovery code to avoid the localization failure by not using the existing cache directories for localization. > The exception happened at {{files.rename(dst_work, destDirPath, Rename.OVERWRITE)}} in FSDownload#call. Based on the following code, after the exception, the existing cache directory used by {{LocalizedResource}} will be deleted. > {code} > try { > ......... > files.rename(dst_work, destDirPath, Rename.OVERWRITE); > } catch (Exception e) { > try { > files.delete(destDirPath, true); > } catch (IOException ignore) { > } > throw e; > } finally { > {code} > Since the conflicting local directory will be deleted after localization failure, > I think it will be better to check if the directory exists before using it for localization to avoid the localization failure. -- This message was sent by Atlassian JIRA (v6.3.4#6332)