Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EF15C200BD0 for ; Wed, 30 Nov 2016 22:08:19 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EDCB3160B21; Wed, 30 Nov 2016 21:08:19 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 44284160B06 for ; Wed, 30 Nov 2016 22:08:19 +0100 (CET) Received: (qmail 37031 invoked by uid 500); 30 Nov 2016 21:08:18 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 37007 invoked by uid 99); 30 Nov 2016 21:08:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2016 21:08:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 229B9E7DE7; Wed, 30 Nov 2016 21:08:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: liuml07@apache.org To: common-commits@hadoop.apache.org Date: Wed, 30 Nov 2016 21:08:19 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/3] hadoop git commit: HADOOP-13830. Intermittent failure of ITestS3NContractRootDir#testRecursiveRootListing: "Can not create a Path from an empty string". Contributed by Steve Loughran archived-at: Wed, 30 Nov 2016 21:08:20 -0000 HADOOP-13830. Intermittent failure of ITestS3NContractRootDir#testRecursiveRootListing: "Can not create a Path from an empty string". Contributed by Steve Loughran (cherry picked from commit 3fd844b99fdfae6be6e5e261f371d175aad14229) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/39b74b6f Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/39b74b6f Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/39b74b6f Branch: refs/heads/branch-2 Commit: 39b74b6f9e1b3b0990f0697990f87606135d35b8 Parents: 3013b02 Author: Mingliang Liu Authored: Wed Nov 30 13:01:02 2016 -0800 Committer: Mingliang Liu Committed: Wed Nov 30 13:04:44 2016 -0800 ---------------------------------------------------------------------- .../org/apache/hadoop/fs/s3native/NativeS3FileSystem.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/39b74b6f/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java ---------------------------------------------------------------------- diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java index 9ae1061..e4e6037 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java @@ -574,7 +574,12 @@ public class NativeS3FileSystem extends FileSystem { for (String commonPrefix : listing.getCommonPrefixes()) { Path subpath = keyToPath(commonPrefix); String relativePath = pathUri.relativize(subpath.toUri()).getPath(); - status.add(newDirectory(new Path(absolutePath, relativePath))); + // sometimes the common prefix includes the base dir (HADOOP-13830). + // avoid that problem by detecting it and keeping it out + // of the list + if (!relativePath.isEmpty()) { + status.add(newDirectory(new Path(absolutePath, relativePath))); + } } priorLastKey = listing.getPriorLastKey(); } while (priorLastKey != null); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org