Return-Path: X-Original-To: apmail-aurora-issues-archive@minotaur.apache.org Delivered-To: apmail-aurora-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D29117C28 for ; Wed, 8 Oct 2014 16:09:55 +0000 (UTC) Received: (qmail 59129 invoked by uid 500); 8 Oct 2014 16:09:55 -0000 Delivered-To: apmail-aurora-issues-archive@aurora.apache.org Received: (qmail 59090 invoked by uid 500); 8 Oct 2014 16:09:55 -0000 Mailing-List: contact issues-help@aurora.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aurora.incubator.apache.org Delivered-To: mailing list issues@aurora.incubator.apache.org Received: (qmail 59081 invoked by uid 99); 8 Oct 2014 16:09:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Oct 2014 16:09:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 08 Oct 2014 16:09:54 +0000 Received: (qmail 58611 invoked by uid 99); 8 Oct 2014 16:09:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Oct 2014 16:09:34 +0000 Date: Wed, 8 Oct 2014 16:09:34 +0000 (UTC) From: "Bill Farner (JIRA)" To: issues@aurora.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AURORA-800) consider using Guava's CycleDetectingLockFactory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AURORA-800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14163663#comment-14163663 ] Bill Farner commented on AURORA-800: ------------------------------------ Not a blocker, but one potential gotcha: {quote} While ReadWriteLock instances have different properties and can form cycles without potential deadlock, this class treats ReadWriteLock instances as equivalent to traditional exclusive locks. Although this increases the false positives that the locks detect (i.e. cycles that will not actually result in deadlock), it simplifies the algorithm and implementation considerably. The assumption is that a user of this factory wishes to eliminate any cyclic acquisition ordering. {quote} Even if we are vulnerable to this, there's no reason we can't use the factory for everything but the storage lock (the only ReadWriteLock we use) for now. > consider using Guava's CycleDetectingLockFactory > ------------------------------------------------ > > Key: AURORA-800 > URL: https://issues.apache.org/jira/browse/AURORA-800 > Project: Aurora > Issue Type: Story > Components: Reliability, Scheduler > Reporter: Kevin Sweeney > Priority: Critical > > Occasional scheduler deadlock bugs would have benefited from proactive detection. Guava provides a utility class, [CycleDetectingLockFactory|http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/util/concurrent/CycleDetectingLockFactory.html], which is well-suited to this task. > Keeping with our general practice of leaving all assertions enabled at runtime unless data suggests performance is impacted, I propose replacing almost all usage of the {{synchronized}} keyword or a {{ReentrantReadWriteLock}} with a {{CycleDetectingLockFactory}}-managed variant unless we have data to suggest performance would be adversely impacted. -- This message was sent by Atlassian JIRA (v6.3.4#6332)