You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucy.apache.org by "Marvin Humphrey (JIRA)" <ji...@apache.org> on 2014/07/27 21:21:39 UTC
[lucy-issues] [jira] [Commented] (LUCY-254) Creation of Charmonizer temp files
sometimes fails on Windows
[ https://issues.apache.org/jira/browse/LUCY-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14075717#comment-14075717 ]
Marvin Humphrey commented on LUCY-254:
--------------------------------------
I was finally able to duplicate this problem consistently using an Amazon EC2 volume with 2 CPUs and magnetic EBS running Windows Server 2012. I believe that the issue has been resolved by continually retrying the remove() call over the course of a second.
Continuous retry might not be the best approach for all projects, but for Charmonizer it seems appropriate.
> Creation of Charmonizer temp files sometimes fails on Windows
> -------------------------------------------------------------
>
> Key: LUCY-254
> URL: https://issues.apache.org/jira/browse/LUCY-254
> Project: Lucy
> Issue Type: Bug
> Components: Charmonizer
> Reporter: Nick Wellnhofer
>
> On Windows, a file won't be deleted until every open handle on it is closed. So if a file is deleted and immediately recreated with the same filename, the creation fails if another process (typically a virus scanner) still has an open handle on it. The solution is to create temporary files with unique names. I propose to add the following function to {{OperatingSystem.c}} and use it for every temp file:
> {noformat}
> char*
> chaz_OS_temp_filename(const char *prefix, const char *ext);
> {noformat}
> It should simply add a number to the filename which is incremented on every call to that function.
> (Currently, the effect is that Charmonizer occasionally fails in {{chaz_Util_remove_and_verify}}. This kind of verification isn't reliable on Windows.)
--
This message was sent by Atlassian JIRA
(v6.2#6252)