[ 
https://issues.apache.org/jira/browse/LUCENE-4308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dawid Weiss updated LUCENE-4308:
--------------------------------

    Attachment: LUCENE-4308.patch

So the problems here are twofold. We should clean up after those unclosed index 
writers. The behavior here is correct (two exceptions) because the second 
exception is a message indicating the temporary folder (for the unclosed 
directory) could not be removed. Not being able to remove a temporary folder is 
a bad thing especially on windows where this may affect things down the 
execution chain.

The second problem is that the behavior of this loop in _testUtil:
{code}
    final Random random = new 
Random(RandomizedContext.current().getRandom().nextLong());
    do {
      result = genTempFile(random, prefix, newSuffix, directory);
    } while (!result.createNewFile());
{code}
is different under windows and 1.6/1.7 (J9 and hotspot) -- when a directory 
with the given "result" filename already exists 1.6 throws an occasional 
IOException and 1.7 returns false.
{code}
Exception in thread "main" java.io.IOException: Access is denied
        at java.io.WinNTFileSystem.createFileExclusively(Native Method)
        at java.io.File.createNewFile(File.java:883)
        at org.apache.lucene.Clazz.main(Clazz.java:25)
{code}

                
> Check what's wrong with reporting unclosed directories with previous errors
> ---------------------------------------------------------------------------
>
>                 Key: LUCENE-4308
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4308
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Dawid Weiss
>            Assignee: Dawid Weiss
>         Attachments: LUCENE-4308.patch
>
>
> {code}
> -Dtests.seed=75DBD696A5D72F04
> -Dtestcase=TestFailIfDirectoryNotClosed
> {code}
> Windows.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to