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 2C1A420049E for ; Thu, 10 Aug 2017 21:30:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2A72716BFCB; Thu, 10 Aug 2017 19:30:04 +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 6F77616BFCA for ; Thu, 10 Aug 2017 21:30:03 +0200 (CEST) Received: (qmail 96147 invoked by uid 500); 10 Aug 2017 19:30:02 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 96136 invoked by uid 99); 10 Aug 2017 19:30:02 -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, 10 Aug 2017 19:30:02 +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 C0D04C181B for ; Thu, 10 Aug 2017 19:30:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id WBx1yX47y7xl for ; Thu, 10 Aug 2017 19:30:01 +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 E33735F3CE for ; Thu, 10 Aug 2017 19:30:00 +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 80959E0DE2 for ; Thu, 10 Aug 2017 19:30:00 +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 3E42A2415E for ; Thu, 10 Aug 2017 19:30:00 +0000 (UTC) Date: Thu, 10 Aug 2017 19:30:00 +0000 (UTC) From: "Wei-Chiu Chuang (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-11900) Hedged reads thread pool creation not synchronized MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 10 Aug 2017 19:30:04 -0000 [ https://issues.apache.org/jira/browse/HDFS-11900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16122172#comment-16122172 ] Wei-Chiu Chuang commented on HDFS-11900: ---------------------------------------- Thanks for the patch John, I kicked off a precommit build for you. > Hedged reads thread pool creation not synchronized > -------------------------------------------------- > > Key: HDFS-11900 > URL: https://issues.apache.org/jira/browse/HDFS-11900 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs-client > Affects Versions: 2.8.0 > Reporter: John Zhuge > Assignee: John Zhuge > Attachments: HDFS-11900.001.patch > > > *Non-static* synchronized method initThreadsNumForHedgedReads can't synchronize the access to the *static* class variable HEDGED_READ_THREAD_POOL. > {code} > private static ThreadPoolExecutor HEDGED_READ_THREAD_POOL; > ... > private synchronized void initThreadsNumForHedgedReads(int num) { > {code} > 2 DFS clients may update the same static variable in a race because the lock is on each DFS client object, not on the shared DFSClient class object. > There are 2 possible fixes: > 1. "Global thread pool": Change initThreadsNumForHedgedReads to static > 2. "Per-client thread pool": Change HEDGED_READ_THREAD_POOL to non-static > From the description for property {{dfs.client.hedged.read.threadpool.size}}: > {quote} > to a positive number. The threadpool size is how many threads to dedicate > to the running of these 'hedged', concurrent reads in your client. > {quote} > it seems to indicate the thread pool is per DFS client. > Let's assume we go with #1 "Global thread pool". One DFS client has the property set to 10 in its config, while the other client has the property set to 5 in its config, what is supposed to the size of the global thread pool? 5? 10? Or 15? > The 2nd fix seems more reasonable to me. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org