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 0893B200CB7 for ; Fri, 16 Jun 2017 03:06:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 07463160BED; Fri, 16 Jun 2017 01:06:08 +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 4D999160BDF for ; Fri, 16 Jun 2017 03:06:07 +0200 (CEST) Received: (qmail 44591 invoked by uid 500); 16 Jun 2017 01:06:04 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 44475 invoked by uid 99); 16 Jun 2017 01:06:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2017 01:06:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 187EE1806B4 for ; Fri, 16 Jun 2017 01:06:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id h1kBtuQ4-KMY for ; Fri, 16 Jun 2017 01:06:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id A7ED15FB96 for ; Fri, 16 Jun 2017 01:06:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 02CA4E0DBB for ; Fri, 16 Jun 2017 01:06:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 31B0624005 for ; Fri, 16 Jun 2017 01:06:00 +0000 (UTC) Date: Fri, 16 Jun 2017 01:06:00 +0000 (UTC) From: "Hongyuan Li (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-14469) FTPFileSystem#listStatus get currentPath and parentPath at the same time, causing recursively list action endless MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 16 Jun 2017 01:06:08 -0000 [ https://issues.apache.org/jira/browse/HADOOP-14469?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 051260#comment-16051260 ]=20 Hongyuan Li commented on HADOOP-14469: -------------------------------------- Thanks fro your review, i will check the code and resubmit it. > FTPFileSystem#listStatus get currentPath and parentPath at the same time,= causing recursively list action endless > -------------------------------------------------------------------------= ---------------------------------------- > > Key: HADOOP-14469 > URL: https://issues.apache.org/jira/browse/HADOOP-14469 > Project: Hadoop Common > Issue Type: Bug > Components: fs, tools/distcp > Affects Versions: 3.0.0-alpha3 > Environment: ftp build by windows7 + Serv-U_64 12.1.0.8=20 > code runs any os > Reporter: Hongyuan Li > Assignee: Hongyuan Li > Priority: Critical > Attachments: HADOOP-14469-001.patch, HADOOP-14469-002.patch, HADO= OP-14469-003.patch > > > for some ftpsystems, liststatus method will return new Path(".") and new = Path(".."), thus causing list op looping.for example, Serv-U > We can see the logic in code below: > {code} > private FileStatus[] listStatus(FTPClient client, Path file) > throws IOException { > =E2=80=A6=E2=80=A6 > FileStatus[] fileStats =3D new FileStatus[ftpFiles.length]; > for (int i =3D 0; i < ftpFiles.length; i++) { > fileStats[i] =3D getFileStatus(ftpFiles[i], absolute); > } > return fileStats; > } > {code} > {code} > public void test() throws Exception{ > FTPFileSystem ftpFileSystem =3D new FTPFileSystem(); > ftpFileSystem.initialize(new Path("ftp://test:123456@192.168.44.1/").= toUri(), > new Configuration()); > FileStatus[] fileStatus =3D ftpFileSystem.listStatus(new Path("/new"= )); > for(FileStatus fileStatus1 : fileStatus) > System.out.println(fileStatus1); > } > {code} > using test code below, the test results list below > {code} > FileStatus{path=3Dftp://test:123456@192.168.44.1/new; isDirectory=3Dtrue;= modification_time=3D1496716980000; access_time=3D0; owner=3Duser; group=3D= group; permission=3D---------; isSymlink=3Dfalse} > FileStatus{path=3Dftp://test:123456@192.168.44.1/; isDirectory=3Dtrue; mo= dification_time=3D1496716980000; access_time=3D0; owner=3Duser; group=3Dgro= up; permission=3D---------; isSymlink=3Dfalse} > FileStatus{path=3Dftp://test:123456@192.168.44.1/new/hadoop; isDirectory= =3Dtrue; modification_time=3D1496716980000; access_time=3D0; owner=3Duser; = group=3Dgroup; permission=3D---------; isSymlink=3Dfalse} > FileStatus{path=3Dftp://test:123456@192.168.44.1/new/HADOOP-14431-002.pat= ch; isDirectory=3Dfalse; length=3D2036; replication=3D1; blocksize=3D4096; = modification_time=3D1495797780000; access_time=3D0; owner=3Duser; group=3Dg= roup; permission=3D---------; isSymlink=3Dfalse} > FileStatus{path=3Dftp://test:123456@192.168.44.1/new/HADOOP-14486-001.pat= ch; isDirectory=3Dfalse; length=3D1322; replication=3D1; blocksize=3D4096; = modification_time=3D1496716980000; access_time=3D0; owner=3Duser; group=3Dg= roup; permission=3D---------; isSymlink=3Dfalse} > FileStatus{path=3Dftp://test:123456@192.168.44.1/new/hadoop-main; isDirec= tory=3Dtrue; modification_time=3D1495797120000; access_time=3D0; owner=3Dus= er; group=3Dgroup; permission=3D---------; isSymlink=3Dfalse} > {code} > In results above, {{FileStatus{path=3Dftp://test:123456@192.168.44.1/new;= =E2=80=A6=E2=80=A6}} is obviously the current Path, and =20 > {{FileStatus{path=3Dftp://test:123456@192.168.44.1/;=E2=80=A6=E2=80=A6}} = is obviously the parent Path. > So, if we want to walk the directory recursively, it will stuck. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-issues-help@hadoop.apache.org