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 4DEDA9668 for ; Sat, 13 Dec 2014 03:35:14 +0000 (UTC) Received: (qmail 2495 invoked by uid 500); 13 Dec 2014 03:35:13 -0000 Delivered-To: apmail-hadoop-yarn-issues-archive@hadoop.apache.org Received: (qmail 2443 invoked by uid 500); 13 Dec 2014 03:35:13 -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 2430 invoked by uid 99); 13 Dec 2014 03:35:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Dec 2014 03:35:13 +0000 Date: Sat, 13 Dec 2014 03:35:13 +0000 (UTC) From: "Varun Saxena (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (YARN-2937) Fix new findbugs warnings in hadoop-yarn-nodemanager 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-2937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14245160#comment-14245160 ] Varun Saxena commented on YARN-2937: ------------------------------------ [~zjshen], bq. What's the problem around Random? There is a problem with Maths#abs. {{Maths.abs(Long.MIN_VALUE)==Long.MIN_VALUE}} i.e. Maths.abs doesnt work with lowest value of long. But Random may return that value. So changed Random to RandomUtils to give only positive values. Maths.abs can probably be removed in this case. Random has {{getInt}} method which can return positive values but no corresponding method for nextLong bq. Can we use IOUtils? Yes, will use it. bq. Is this removed because bufReader will consequently close fileReader too? No. This has been removed because instance of class {{FileReader}} has been removed and replaced with {{FileInputStream}} + {{InputStreamReader}}. This is because FileReader doesnt allow us to set Charset encoding. And yes, BufferedReader will close the underlying FileReader and FileReader will close the underlying stream. bq. Again, would you mind explaining a bit about what have been excluded in findbugs-exclude.xml? The exclusions are corresponding to *RV_RETURN_VALUE_IGNORED_BAD_PRACTICE*. Findbugs was complaining about return value of {{ThreadPoolExecutor#submit}} being ignored. This method returns a {{Future}} object. Generally {{Future#get}} is called to check the return value of executor. But this method is blocking and waits for thread execution to complete. If I call this, it would break the current behavior. Tried it as well and some test cases failed. Another alternative is to call {{Future#isDone}} but this most likely will always return false if you check it immediately. So I see no point in checking return value of call to submit. Hence, added it in exclusions. Findbugs was raising issue for below 2 lines. {code:title=ContainersLauncher.java:118|borderStyle=solid} containerLauncher.submit(launch); {code} {code:title=SharedCacheUploadService.java:118|borderStyle=solid} uploaderPool.submit(uploader); {code} > Fix new findbugs warnings in hadoop-yarn-nodemanager > ---------------------------------------------------- > > Key: YARN-2937 > URL: https://issues.apache.org/jira/browse/YARN-2937 > Project: Hadoop YARN > Issue Type: Improvement > Reporter: Varun Saxena > Assignee: Varun Saxena > Fix For: 2.7.0 > > Attachments: HADOOP-11373.patch, YARN-2937.001.patch, YARN-2937.002.patch, YARN-2937.003.patch > > -- This message was sent by Atlassian JIRA (v6.3.4#6332)