Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 80812 invoked from network); 16 Oct 2009 16:50:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Oct 2009 16:50:11 -0000 Received: (qmail 63975 invoked by uid 500); 16 Oct 2009 16:50:09 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 63886 invoked by uid 500); 16 Oct 2009 16:50:09 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 63876 invoked by uid 99); 16 Oct 2009 16:50:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Oct 2009 16:50:09 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ctignor@thinkmap.com designates 209.85.220.216 as permitted sender) Received: from [209.85.220.216] (HELO mail-fx0-f216.google.com) (209.85.220.216) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Oct 2009 16:50:00 +0000 Received: by fxm12 with SMTP id 12so2783169fxm.5 for ; Fri, 16 Oct 2009 09:49:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.25.27 with SMTP id x27mr328021fab.7.1255711780013; Fri, 16 Oct 2009 09:49:40 -0700 (PDT) Date: Fri, 16 Oct 2009 12:49:39 -0400 Message-ID: <6f287d1b0910160949te8bb4a9xaa6815c6ca936eca@mail.gmail.com> Subject: IndexWriter optimize() deadlock From: Christopher Tignor To: java-user Content-Type: multipart/alternative; boundary=0015174757429688150476102e2a X-Virus-Checked: Checked by ClamAV on apache.org --0015174757429688150476102e2a Content-Type: text/plain; charset=ISO-8859-1 Hello, I am trying to track down the cause of my code hanging on calling IndexWriter.optimize() at its doWait() method. It appears, thus that it is watiing on other merges to happen which is a bit confusing to me: My application is a simple producer consumer model where documents are added to a queue by producers and then one consumer with one indexwriter (the only in the application) periodically calls addDocument() on a batch of these jobs and then calls optimize(), commit(). and then close(). There is only one thread running the consumer so I am confused as to how the indexwriter might be deadlocking itself. Indeed this is the only thread active when the deadlock occurs so it seems to be a problem of reentry. Importantly, the deadlocking occurs only when the thread is trying to shutdown - that is the Thread running this lucene consumer has a Future that has had its cancel(true) interrupting method called. Is it possible that an internal Lucene lock is obtained during addDocument() and on interruption is never released so the subsequent optimize() call hangs? This doesn't appear to be happening... Any help appreciated. thanks, C>T> what might I be missing here? -- TH!NKMAP Christopher Tignor | Senior Software Architect 155 Spring Street NY, NY 10012 p.212-285-8600 x385 f.212-285-8999 --0015174757429688150476102e2a--