Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E923B17C8C for ; Thu, 6 Nov 2014 21:05:34 +0000 (UTC) Received: (qmail 72491 invoked by uid 500); 6 Nov 2014 21:05:34 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 72443 invoked by uid 500); 6 Nov 2014 21:05:34 -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 72430 invoked by uid 99); 6 Nov 2014 21:05:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Nov 2014 21:05:34 +0000 Date: Thu, 6 Nov 2014 21:05:34 +0000 (UTC) From: "Andrew Purtell (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-12431) Use of getColumnLatestCell(byte[], int, int, byte[], int, int) is Not Thread Safe 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/HBASE-12431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Purtell updated HBASE-12431: ----------------------------------- Fix Version/s: 0.99.2 0.98.8 2.0.0 Set fix versions > Use of getColumnLatestCell(byte[], int, int, byte[], int, int) is Not Thread Safe > --------------------------------------------------------------------------------- > > Key: HBASE-12431 > URL: https://issues.apache.org/jira/browse/HBASE-12431 > Project: HBase > Issue Type: Bug > Components: Client > Affects Versions: 0.98.1 > Reporter: Jonathan Jarvis > Assignee: Jingcheng Du > Fix For: 2.0.0, 0.98.8, 0.99.2 > > Attachments: HBASE-12431-V2.diff, HBASE-12431.diff > > > Result declares that it is NOT THREAD SAFE at the top of the source code, but one would assume that refers to many different threads accessing the same Result object. I've run into an issue when I have several different threads accessing their own Result object that runs into an issue because of use of common static member variable. > I noticed the problem when I switched from: > getColumnLatestCell(byte[], byte[]) to > getColumnLatestCell(byte[], int, int, byte[], int, int) > These methods call different binarySearch methods, the latter invoking: > protected int binarySearch(final Cell [] kvs, > 309 final byte [] family, final int foffset, final int flength, > 310 final byte [] qualifier, final int qoffset, final int qlength) { > This method utilizes a private static member variable called "buffer" > If more than one thread is utilizing "buffer" you'll see unpredictable behavior unless you synchronize(Result.class) {}. > If buffer is to remain a static variable, I would recommend changing it to a ThreadLocal instead. -- This message was sent by Atlassian JIRA (v6.3.4#6332)