Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 75899 invoked from network); 5 Aug 2006 06:16:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Aug 2006 06:16:20 -0000 Received: (qmail 78786 invoked by uid 500); 5 Aug 2006 06:16:15 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 78288 invoked by uid 500); 5 Aug 2006 06:16:14 -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 78277 invoked by uid 99); 5 Aug 2006 06:16:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Aug 2006 23:16:13 -0700 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [217.12.10.208] (HELO web25910.mail.ukl.yahoo.com) (217.12.10.208) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 04 Aug 2006 23:16:11 -0700 Received: (qmail 19329 invoked by uid 60001); 5 Aug 2006 06:15:50 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Message-ID:Received:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=1Rwfxc2UXLDSL+mfcUSkIdIH4Q3peFiz9/z9drVXtCDlkleh7/KdRqR0IKKuq4q9CsofKPsfcnAk5PG2JeqY/wpkfrNh3pok/TwGvSer79WsD/1XxIsjTqmY83Ok13ilaNm+Mmmoz4EuJgzqxTseeC1xm1jzHcPaNTsOydIJj9o= ; Message-ID: <20060805061550.19327.qmail@web25910.mail.ukl.yahoo.com> Received: from [84.131.236.86] by web25910.mail.ukl.yahoo.com via HTTP; Sat, 05 Aug 2006 06:15:50 GMT Date: Sat, 5 Aug 2006 06:15:50 +0000 (GMT) From: eks dev Reply-To: eks dev Subject: Re: running a lucene indexing app as a windows service on xp, crashing To: java-user@lucene.apache.org In-Reply-To: <44D3BBE2.6050203@mikemccandless.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is windows/jvm issue . Have a look at how ant is dealing with it, maybe we could give it a try with something like that (I have not noticed ant having problems). We are not able to reproduce this in our environment systematically, so it would be great if you could patch your lucene with this trick and let us know how it goes. delete/rename->System.gc()->Thread.sleap()->delete/rename Again /** * Accommodate Windows bug encountered in both Sun and IBM JDKs. * Others possible. If the delete does not work, call System.gc(), * wait a little and try again. */ private boolean delete(File f) { if (!f.delete()) { System.gc(); try { Thread.sleep(DELETE_RETRY_SLEEP_MILLIS); } catch (InterruptedException ex) { // Ignore Exception } if (!f.delete()) { if (deleteOnExit) { int level = quiet ? Project.MSG_VERBOSE : Project.MSG_INFO; log("Failed to delete " + f + ", calling deleteOnExit." + " This attempts to delete the file when the Ant jvm" + " has exited and might not succeed.", level); f.deleteOnExit(); return true; } return false; } } return true; } ----- Original Message ---- From: Michael McCandless To: java-user@lucene.apache.org Sent: Friday, 4 August, 2006 11:28:02 PM Subject: Re: running a lucene indexing app as a windows service on xp, crashing > The Lucene code is crashing under circumstances that seem pretty lame. > At periodic intervals, lucene tries to File.renameTo(newfile). > Sometimes this fails, so Lucene implemented some fall-back code to > manually copy the contents of the file from old to new. Our problem is > that sometimes *this* fails too, then the whole thing blows up. I agree Lucene should not be affected by things like having Windows Explorer windows up! Can you post the traceback you're seeing? In particular, what's failing about the fallback approach? Is it in the FSDirectory's renameFile method? There is this comment in there: // Rename the old file to the new one. Unfortunately, the renameTo() // method does not work reliably under some JVMs. Therefore, if the // rename fails, we manually rename by copying the old file to the new one and correspondingly this comment in the original commit for this (back on March 1 2003): - Added a manual renaming of files in case the java.io.File's renameTo(File) call fails. It has been reported that this happens on Windows JVMs. Contributed by: Matt Tucker Mike --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org