Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0AD104E84 for ; Thu, 23 Jun 2011 14:12:12 +0000 (UTC) Received: (qmail 8087 invoked by uid 500); 23 Jun 2011 14:12:10 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 8036 invoked by uid 500); 23 Jun 2011 14:12:10 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 8029 invoked by uid 99); 23 Jun 2011 14:12:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jun 2011 14:12:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jun 2011 14:12:08 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 5E54F42B15B for ; Thu, 23 Jun 2011 14:11:47 +0000 (UTC) Date: Thu, 23 Jun 2011 14:11:47 +0000 (UTC) From: "Michael McCandless (JIRA)" To: dev@lucene.apache.org Message-ID: <325929129.33297.1308838307383.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1575664989.29545.1308751967646.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (LUCENE-3230) Make FSDirectory.fsync() public and static 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/LUCENE-3230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053872#comment-13053872 ] Michael McCandless commented on LUCENE-3230: -------------------------------------------- This seems OK, but my only worry is.... I'm not sure this way of fsync'ing really "works"? Ie, this code opens a r/w RAF, calls sync, closes it. It's not clear that this is guaranteed to sync file handles open in the past against the same file. This is something we separately should look into / fix, but with this uncertainty it makes me nervous exposing this as a public API... maybe we could expose it with a big warning. bq. Also, while reviewing the code, I noticed that if IOE occurs, the code sleeps for 5 msec. If an InterruptedException occurs then, it immediately throws ThreadIE, completely ignoring the fact that it slept due to IOE. Shouldn't we at least pass IOE.getMessage() on ThreadIE? +1 > Make FSDirectory.fsync() public and static > ------------------------------------------ > > Key: LUCENE-3230 > URL: https://issues.apache.org/jira/browse/LUCENE-3230 > Project: Lucene - Java > Issue Type: New Feature > Components: core/store > Reporter: Shai Erera > Assignee: Shai Erera > Priority: Minor > Fix For: 3.3, 4.0 > > > I find FSDirectory.fsync() (today protected and instance method) very useful as a utility to sync() files. I'd like create a FSDirectory.sync() utility which contains the exact same impl of FSDir.fsync(), and have the latter call it. We can have it part of IOUtils too, as it's a completely standalone utility. > I would get rid of FSDir.fsync() if it wasn't protected (as if encouraging people to override it). I doubt anyone really overrides it (our core Directories don't). > Also, while reviewing the code, I noticed that if IOE occurs, the code sleeps for 5 msec. If an InterruptedException occurs then, it immediately throws ThreadIE, completely ignoring the fact that it slept due to IOE. Shouldn't we at least pass IOE.getMessage() on ThreadIE? > The patch is trivial, so I'd like to get some feedback before I post it. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org