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 F1CBA2009E8 for ; Mon, 30 May 2016 23:01:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F099D160A19; Mon, 30 May 2016 21:01:14 +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 430E7160969 for ; Mon, 30 May 2016 23:01:14 +0200 (CEST) Received: (qmail 50999 invoked by uid 500); 30 May 2016 21:01:13 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 50987 invoked by uid 99); 30 May 2016 21:01:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 May 2016 21:01:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CC4C82C14F8 for ; Mon, 30 May 2016 21:01:12 +0000 (UTC) Date: Mon, 30 May 2016 21:01:12 +0000 (UTC) From: "Ed Coleman (JIRA)" To: notifications@accumulo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (ACCUMULO-4319) Possible synchronization issue in ZooStore reserve(long tid) method MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 30 May 2016 21:01:15 -0000 [ https://issues.apache.org/jira/browse/ACCUMULO-4319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ed Coleman updated ACCUMULO-4319: --------------------------------- Status: Patch Available (was: Open) Patch with functional IT test for ZooStore shows that this is not an issue. > Possible synchronization issue in ZooStore reserve(long tid) method > ------------------------------------------------------------------- > > Key: ACCUMULO-4319 > URL: https://issues.apache.org/jira/browse/ACCUMULO-4319 > Project: Accumulo > Issue Type: Bug > Affects Versions: 1.6.5, 2.0.0 > Reporter: Ed Coleman > Attachments: ACCUMULO-4319-tests.patch > > > I am reporting this for investigation - not sure if it is a bug, but from code inspection it seems that the ZooStore reserve(tx_id) can cause a deadlock if it is called while the tx_id is already reserved. From inspection it seems that all methods that remove tx_ids are also synchronized and would block and be unable to remove the tx_id so that the reserve could continue. > I'm not sure this happens and the only way to determine would possible be from logging in the calling code - or by examining stack traces because there is no logging in this method. > The code: > {noformat} > public void reserve(long tid) { > synchronized (this) { > reservationsWaiting++; > try { > while (reserved.contains(tid)) > try { > this.wait(1000); > } catch (InterruptedException e) { > throw new RuntimeException(e); > } > reserved.add(tid); > } finally { > reservationsWaiting--; > } > } > } > {noformat} > It seems that a unit test could be created that would deadlock, but that may be synthetic and "never happen", hoping someone knows why and this can just be closed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)