Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 44555 invoked from network); 4 Mar 2008 10:17:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Mar 2008 10:17:51 -0000 Received: (qmail 96204 invoked by uid 500); 4 Mar 2008 10:17:45 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 96169 invoked by uid 500); 4 Mar 2008 10:17:45 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 96158 invoked by uid 99); 4 Mar 2008 10:17:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2008 02:17:44 -0800 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2008 10:17:18 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 94CE2234C03B for ; Tue, 4 Mar 2008 02:16:40 -0800 (PST) Message-ID: <758169228.1204625800587.JavaMail.jira@brutus> Date: Tue, 4 Mar 2008 02:16:40 -0800 (PST) From: "Michael McCandless (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Created: (LUCENE-1200) IndexWriter.addIndexes* can deadlock in rare cases MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org IndexWriter.addIndexes* can deadlock in rare cases -------------------------------------------------- Key: LUCENE-1200 URL: https://issues.apache.org/jira/browse/LUCENE-1200 Project: Lucene - Java Issue Type: Bug Components: Index Affects Versions: 2.4 Reporter: Michael McCandless Assignee: Michael McCandless Priority: Minor Fix For: 2.4 In somewhat rare cases it's possible for addIndexes to deadlock because it is a synchronized method. Normally the merges that are necessary for addIndexes are done serially (with the primary thread) because they involve segments from an external directory. However, if mergeFactor of these merges complete then a merge becomes necessary for the merged segments, which are not external, and so it can run in the background. If too many BG threads need to run (currently > 4) then the "pause primary thread" approach adopted in LUCENE-1164 will deadlock, because the addIndexes method is holding a lock on IndexWriter. This was appearing as a intermittant deadlock in the TestIndexWriterMerging test case. This issue is not present in 2.3 (it was caused by LUCENE-1164). The solution is to shrink the scope of synchronization: don't synchronize on the whole method & wrap synchronized(this) in the right places inside the methods. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org