From common-issues-return-146725-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Thu Jan 11 20:47:10 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 6ECC0180656 for ; Thu, 11 Jan 2018 20:47:10 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5DDD5160C23; Thu, 11 Jan 2018 19:47:10 +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 AC84C160C13 for ; Thu, 11 Jan 2018 20:47:09 +0100 (CET) Received: (qmail 14358 invoked by uid 500); 11 Jan 2018 19:47:08 -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 14342 invoked by uid 99); 11 Jan 2018 19:47:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jan 2018 19:47:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 19898C00A0 for ; Thu, 11 Jan 2018 19:47:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.911 X-Spam-Level: X-Spam-Status: No, score=-99.911 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id C3NcnOYW5C1Y for ; Thu, 11 Jan 2018 19:47:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C4DAA5F47E for ; Thu, 11 Jan 2018 19:47:06 +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 0C3DFE2578 for ; Thu, 11 Jan 2018 19:47:06 +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 90576255CC for ; Thu, 11 Jan 2018 19:47:05 +0000 (UTC) Date: Thu, 11 Jan 2018 19:47:05 +0000 (UTC) From: "Steve Loughran (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-14788) Credentials readTokenStorageFile to stop wrapping IOEs in IOEs 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/HADOOP-14788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16322842#comment-16322842 ] Steve Loughran commented on HADOOP-14788: ----------------------------------------- h3. Exception type I just like the fact that PathIOE preserves that path, and having something typed better than just IOE is useful. If you look at the subclasses of that path, you can see that its gone to more than just the original set of Posix calls, though I will add the caveat, I think that most of those subclasses are mine. The key thing is: a subclass of IOE is better in try/catch and tests .h3 tests And, on the toopic of tests, I'd like them split in two, and I'm going to propose moving to LambdaTestUtils.intercept, for the java8 way to handle this. To backport to Branch2, IntelliJ will convert the lambda-expression into an anonymous class at the click of a button. Here's my conversion of the calls {code} EOFException returnedEx = LambdaTestUtils(EOFException.class, "Failed with " + "java.io.EOFException while processing file/directory " + ":[/tmp/abc.txt] in method:[testWrapException]" ()-> IOUtils.wrapException("/tmp/abc.txt", "testWrapEx", ex)); {code} Second one {code} PathIOException returnedEx = LambdaTestUtils(PathIOException.class, "Input/output error:", ()-> IOUtils.wrapException("/tmp/abc.txt", "testWrapEx", ex)); assertEquals("/tmp/abc.txt", returnedEx.getPath().toString()); {code} > Credentials readTokenStorageFile to stop wrapping IOEs in IOEs > -------------------------------------------------------------- > > Key: HADOOP-14788 > URL: https://issues.apache.org/jira/browse/HADOOP-14788 > Project: Hadoop Common > Issue Type: Bug > Components: security > Affects Versions: 2.8.1 > Reporter: Steve Loughran > Assignee: Ajay Kumar > Priority: Minor > Attachments: HADOOP-14788.001.patch, HADOOP-14788.002.patch, HADOOP-14788.003.patch, HADOOP-14788.004.patch > > > When {{Credentials readTokenStorageFile}} gets an IOE. it catches & wraps with the filename, so losing the exception class information. > Is this needed. or can it pass everything up? > If it is needed, well, it's a common pattern: wrapping the exception with the path & operation. Maybe it's time to add an IOE version of {{NetworkUtils.wrapException()}} which handles the broader set of IOEs -- 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