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 E5294200C8B for ; Mon, 22 May 2017 10:49:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E396A160BD9; Mon, 22 May 2017 08:49:08 +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 3551F160BA5 for ; Mon, 22 May 2017 10:49:08 +0200 (CEST) Received: (qmail 72340 invoked by uid 500); 22 May 2017 08:49:07 -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 72318 invoked by uid 99); 22 May 2017 08:49:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 May 2017 08:49:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 015D4C28F9 for ; Mon, 22 May 2017 08:49:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id QgMkhAbRcwIG for ; Mon, 22 May 2017 08:49:06 +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 AA6325FC85 for ; Mon, 22 May 2017 08:49:05 +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 2FEA0E01D9 for ; Mon, 22 May 2017 08:49:05 +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 5068521B5A for ; Mon, 22 May 2017 08:49:04 +0000 (UTC) Date: Mon, 22 May 2017 08:49:04 +0000 (UTC) From: "Yu Li (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-18085) Prevent parallel purge in ObjectPool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 22 May 2017 08:49:09 -0000 [ https://issues.apache.org/jira/browse/HBASE-18085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16019300#comment-16019300 ] Yu Li commented on HBASE-18085: ------------------------------- From the micro benchmark result, tryLock is much better. Let me know if any question on the benchmark code/result, thanks. [~anoop.hbase] > Prevent parallel purge in ObjectPool > ------------------------------------ > > Key: HBASE-18085 > URL: https://issues.apache.org/jira/browse/HBASE-18085 > Project: HBase > Issue Type: Bug > Reporter: Yu Li > Assignee: Yu Li > Attachments: e89l05465.st3.jstack, HBASE-18085.patch > > > Parallel purge in ObjectPool is meaningless and will cause contention issue since {{ReferenceQueue#poll}} has synchronization (source code shown below) > {code} > public Reference poll() { > if (head == null) > return null; > synchronized (lock) { > return reallyPoll(); > } > } > {code} > We observed threads blocking on the purge method while using offheap bucket cache, and we could easily reproduce this by testing the 100% cache hit case in bucket cache with enough reading threads. > We propose to add a purgeLock and use tryLock to avoid parallel purge. -- This message was sent by Atlassian JIRA (v6.3.15#6346)