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 3EED2200C53 for ; Tue, 11 Apr 2017 17:04:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3D74E160B9B; Tue, 11 Apr 2017 15:04:46 +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 84729160B89 for ; Tue, 11 Apr 2017 17:04:45 +0200 (CEST) Received: (qmail 14396 invoked by uid 500); 11 Apr 2017 15:04:44 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 14385 invoked by uid 99); 11 Apr 2017 15:04:44 -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; Tue, 11 Apr 2017 15:04:44 +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 317DDCDA96 for ; Tue, 11 Apr 2017 15:04:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[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 2icUwMkWdN4S for ; Tue, 11 Apr 2017 15:04:43 +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 26D1F61A5D for ; Tue, 11 Apr 2017 15:04:43 +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 9B805E0D65 for ; Tue, 11 Apr 2017 15:04:42 +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 E48822408B for ; Tue, 11 Apr 2017 15:04:41 +0000 (UTC) Date: Tue, 11 Apr 2017 15:04:41 +0000 (UTC) From: "stack (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-6651) Improve thread safety of HTablePool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 11 Apr 2017 15:04:46 -0000 [ https://issues.apache.org/jira/browse/HBASE-6651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15964488#comment-15964488 ] stack commented on HBASE-6651: ------------------------------ [~chia7712] Yes (though give the issue a skim because [~ikeda] finds good stuff -- there might be something in here that appiies beyond HTP. Open new issue if something found?) > Improve thread safety of HTablePool > ----------------------------------- > > Key: HBASE-6651 > URL: https://issues.apache.org/jira/browse/HBASE-6651 > Project: HBase > Issue Type: Bug > Components: Client > Affects Versions: 0.94.1 > Reporter: Hiroshi Ikeda > Assignee: Hiroshi Ikeda > Attachments: HBASE-6651.patch, HBASE-6651-V10.patch, HBASE-6651-V11.patch, HBASE-6651-V12.patch, HBASE-6651-V13.patch, HBASE-6651-V14-0.96.patch, HBASE-6651-V14-0.98.patch, HBASE-6651-V14-trunk.patch, HBASE-6651-V15-0.96.patch, HBASE-6651-V15-0.98.patch, HBASE-6651-V15-trunk.patch, HBASE-6651-V16-0.96.patch, HBASE-6651-V16-0.98.patch, HBASE-6651-V16-trunk.patch, HBASE-6651-V2.patch, HBASE-6651-V3.patch, HBASE-6651-V4.patch, HBASE-6651-V5.patch, HBASE-6651-V6.patch, HBASE-6651-V7.patch, HBASE-6651-V8.patch, HBASE-6651-V9.patch, sample.zip, sample.zip, sharedmap_for_hbaseclient.zip > > > There are some operations in HTablePool accessing PoolMap in multiple places without any explicit synchronization. > For example HTablePool.closeTablePool() calls PoolMap.values(), and calls PoolMap.remove(). If other threads add new instances to the pool in the middle of the calls, the newly added instances might be dropped. (HTablePool.closeTablePool() also has another problem that calling it by multiple threads causes accessing HTable by multiple threads.) > Moreover, PoolMap is not thread safe for the same reason. > For example PoolMap.put() calles ConcurrentMap.get() and calles ConcurrentMap.put(). If other threads add a new instance to the concurent map in the middle of the calls, the new instance might be dropped. > And also implementations of Pool have the same problems. -- This message was sent by Atlassian JIRA (v6.3.15#6346)