Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 67890 invoked from network); 21 Aug 2006 11:02:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Aug 2006 11:02:19 -0000 Received: (qmail 2179 invoked by uid 500); 21 Aug 2006 11:02:18 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 2149 invoked by uid 500); 21 Aug 2006 11:02:18 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 2140 invoked by uid 99); 21 Aug 2006 11:02:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Aug 2006 04:02:17 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Aug 2006 04:02:17 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id F39847142C9 for ; Mon, 21 Aug 2006 10:59:13 +0000 (GMT) Message-ID: <30458058.1156157953994.JavaMail.jira@brutus> Date: Mon, 21 Aug 2006 03:59:13 -0700 (PDT) From: "Rod Mackenzie (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Created: (JCR-546) Deadlock during checkin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Deadlock during checkin ------------------------ Key: JCR-546 URL: http://issues.apache.org/jira/browse/JCR-546 Project: Jackrabbit Issue Type: Bug Components: versioning Environment: WinXP Jackrabbit r431916 Reporter: Rod Mackenzie Priority: Critical Under a load of 3 threads performing checkin and restore operations it's possible for all to become deadlocked in AbstractVersionManager.checkin(). This method attempts to upgrade a read lock to a write lock with the following code aquireReadLock(); .... try { aquireWriteLock(); releaseReadLock(); ... If 2 or more threads acquire the read lock then neither can acquire the write lock resulting in the deadlock, and after that any other thread that calls this method will block waiting for the write lock. The release of the read lock needs to be done before acquiring the write lock, this is documented Concurrent library javadoc. There is another area where there is an attempt to upgrade a read lock to write lock, RepositoryImpl.WorkspaceInfo.disposeIfIdle() acquires a read lock and calls dispose() which then acquires a write lock, this maybe ok, as I assume there is only 1 thread that will attempt to dispose of idle workspaces. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira