From common-issues-return-153309-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Tue Jun 5 20:41:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 57ABD18067B for ; Tue, 5 Jun 2018 20:41:05 +0200 (CEST) Received: (qmail 3558 invoked by uid 500); 5 Jun 2018 18:41: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 3547 invoked by uid 99); 5 Jun 2018 18:41: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; Tue, 05 Jun 2018 18:41: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 D1AED1806B9 for ; Tue, 5 Jun 2018 18:41:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, 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 2sG89QWsgTox for ; Tue, 5 Jun 2018 18:41: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 A843E5F4A9 for ; Tue, 5 Jun 2018 18:41:02 +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 03572E0F7F for ; Tue, 5 Jun 2018 18:41:02 +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 6F23021097 for ; Tue, 5 Jun 2018 18:41:01 +0000 (UTC) Date: Tue, 5 Jun 2018 18:41:01 +0000 (UTC) From: "Chris Douglas (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Moved] (HADOOP-15515) adl.AdlFilesystem.close() doesn't release locks on open files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-15515?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chris Douglas moved HDFS-13344 to HADOOP-15515: ----------------------------------------------- Affects Version/s: (was: 2.7.3) 2.7.3 Component/s: (was: fs/adl) fs/adl Key: HADOOP-15515 (was: HDFS-13344) Project: Hadoop Common (was: Hadoop HDFS) > adl.AdlFilesystem.close() doesn't release locks on open files > ------------------------------------------------------------- > > Key: HADOOP-15515 > URL: https://issues.apache.org/jira/browse/HADOOP-15515 > Project: Hadoop Common > Issue Type: Bug > Components: fs/adl > Affects Versions: 2.7.3 > Environment: HDInsight on MS Azure: > =C2=A0 > Hadoop 2.7.3.2.6.2.25-1 > Subversion git@github.com:hortonworks/hadoop.git -r 1ceeb58bb3bb5904df0cb= b7983389bcaf2ffd0b6 > Compiled by jenkins on 2017-11-29T15:28Z > Compiled with protoc 2.5.0 > From source with checksum 90b73c4c185645c1f47b61f942230 > This command was run using /usr/hdp/2.6.2.25-1/hadoop/hadoop-common-2.7.3= .2.6.2.25-1.jar > Reporter: Jay Hankinson > Assignee: Vishwajeet Dusane > Priority: Major > Attachments: HDFS-13344-001.patch, HDFS-13344-002.patch > > > If you write to a file on and Azure ADL filesystem and close the file sys= tem but not the file before the process exits, the next time you try open t= he file for append it fails with: > Exception in thread "main" java.io.IOException: APPEND failed with error = 0x83090a16 (Failed to perform the requested operation because the file is c= urrently open in write mode by another user or process.). [a67c6b32-e78b-48= 52-9fac-142a3e2ba963][2018-03-22T20:54:08.3520940-07:00] > =C2=A0The following moves local file to HDFS if it doesn't exist or appen= ds it's contents if it does: > =C2=A0 > {code:java} > public void addFile(String source, String dest, Configuration conf) throw= s IOException { > FileSystem fileSystem =3D FileSystem.get(conf); > // Get the filename out of the file path > String filename =3D source.substring(source.lastIndexOf('/') + 1,source.l= ength()); > // Create the destination path including the filename. > if (dest.charAt(dest.length() - 1) !=3D '/') > { dest =3D dest + "/" + filename; } > else { > dest =3D dest + filename; > } > // Check if the file already exists > Path path =3D new Path(dest); > FSDataOutputStream out; > if (fileSystem.exists(path)) { > System.out.println("File " + dest + " already exists appending"); > out =3D fileSystem.append(path); > } else { > out =3D fileSystem.create(path); > } > // Create a new file and write data to it. > InputStream in =3D new BufferedInputStream(new FileInputStream(new File( > source))); > byte[] b =3D new byte[1024]; > int numBytes =3D 0; > while ((numBytes =3D in.read(b)) > 0) { > out.write(b, 0, numBytes); > } > // Close the file system not the file > in.close(); > //out.close(); > fileSystem.close(); > } > {code} > If "dest" is an adl:// location, invoking the function a second time (af= ter the process has exited) it raises the error. If it's a regular hdfs:// = file system, it doesn't as all the locks are released. The same exception i= s also raised if a subsequent append is done using:=C2=A0hdfs dfs=C2=A0=C2= =A0-appendToFile. > As I can't see a way to force lease recovery in this situation, this seem= s like a bug. org.apache.hadoop.fs.adl.AdlFileSystem=C2=A0inherits close() = from=C2=A0org.apache.hadoop.fs.FileSystem > [https://hadoop.apache.org/docs/r3.0.0/api/org/apache/hadoop/fs/adl/AdlFi= leSystem.html] > Which states: > Close this FileSystem instance. Will release any held locks. This does no= t seem to be the case -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-issues-help@hadoop.apache.org