Return-Path: Delivered-To: apmail-incubator-ace-dev-archive@minotaur.apache.org Received: (qmail 37466 invoked from network); 14 Jan 2011 17:14:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Jan 2011 17:14:13 -0000 Received: (qmail 68164 invoked by uid 500); 14 Jan 2011 17:14:13 -0000 Delivered-To: apmail-incubator-ace-dev-archive@incubator.apache.org Received: (qmail 68100 invoked by uid 500); 14 Jan 2011 17:14:11 -0000 Mailing-List: contact ace-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ace-dev@incubator.apache.org Delivered-To: mailing list ace-dev@incubator.apache.org Received: (qmail 68085 invoked by uid 99); 14 Jan 2011 17:14:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jan 2011 17:14:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jan 2011 17:14:07 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p0EHDj1q017342 for ; Fri, 14 Jan 2011 17:13:46 GMT Message-ID: <11326238.371161295025225880.JavaMail.jira@thor> Date: Fri, 14 Jan 2011 12:13:45 -0500 (EST) From: "Angelo van der Sijpt (JIRA)" To: ace-dev@incubator.apache.org Subject: [jira] Resolved: (ACE-105) Deadlock on (client) RepositoryAdmin.commit() In-Reply-To: <6000731.354561294954485972.JavaMail.jira@thor> 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/ACE-105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Angelo van der Sijpt resolved ACE-105. -------------------------------------- Resolution: Fixed I've checked and applied your patch; please close if delighted. > Deadlock on (client) RepositoryAdmin.commit() > --------------------------------------------- > > Key: ACE-105 > URL: https://issues.apache.org/jira/browse/ACE-105 > Project: Ace > Issue Type: Bug > Affects Versions: 0.8.0 > Reporter: Dennis Geurts > Assignee: Angelo van der Sijpt > Attachments: ace-roi.patch, dump.txt > > > During a commit of changes to the repository, I have reached a deadlock. > Basically, what happens is the following: > The commit() action triggers a call to commit on all repository sets. This triggers a serialization to XML of the repositories. During this action, each repository is set to busy, which eventually sets all contained RepositoryObject to busy ( i.e. RepositoryObjectImpl.setBusy() is called). This is where a lock is created, first on its attributes, then on its associations. > Meanwhile, based on an asynchronous EventAdmin event, it is decided that a new deployment version is required for a particular target. During this deployment creation process, it is possible that we loop over all objects in the repository. During this process we end up in the getAssociations() call of the same RepositoryObjectImpl, that was just set to busy. Unfortunately, this call to getAssociations() first locks the contained associations. Then, during the equals() call, a lock is created on the contained attributes. > This can lead to a deadlock. I will attach a threaddump that reproduces the issue. > I propose the following patch (see attachemnt) where in the RepositoryObjectImpl.setBusy() call the lock order is reversed. > After applying this patch locally, I have not been able to reproduce this deadlock anymore. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.