[ 
https://issues.apache.org/jira/browse/LUCENE-6835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15134510#comment-15134510
 ] 

Michael McCandless commented on LUCENE-6835:
--------------------------------------------

I pushed some more changes:

Too many tests were angry when VirusCheckingFS is randomly used,
because they'll do things like create an FSDir, open a writer, index
docs, close the writer and then open a new writer (on the same dir
instance), which will fail if the virus checker had prevented file
deletion and they remain not deletable (IndexWriter detects this on
startup).

Or they try to directly remove files from their temp dir...

So I took VirusCheckingFS out of the random rotation: I think it's too
much (and not helpful) to expect our tests to work with badly behaved
virus checkers.

Instead I turned on the virus checker randomly in a few tests, using a
new {{LTC.newMaybeVirusCheckingDirectory}}.

I think the changes here to {{FSDirectory}} are not pretty ... I think
we may want to pull out the "retry deletions" from {{FSDirectory}}
into a new {{WindowsFSDirectory}} or a wrapper or something ... but I
think we should do this separately.  I think this issue is a good step
forward to migrating OS specifics down lower in the stack, and it's
not easy: progress not perfection!

Also, the {{VirusCheckingFS}} only interferes with {{Files.delete}}
today, but I imagine a real evil virus checker would do other things
like prevent renaming a file.  But then, Lucene already does not
protect against that anymore (only retry on delete).

I think the latest branch is ready ... distributed beasting only
uncovered an unrelated issue (LUCENE-7017).  I'll merge soon.


> Directory.deleteFile should "own" retrying deletions on Windows
> ---------------------------------------------------------------
>
>                 Key: LUCENE-6835
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6835
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>             Fix For: 5.5, master, 6.0
>
>         Attachments: LUCENE-6835.patch, LUCENE-6835.patch
>
>
> Rob's idea:
> Today, we have hairy logic in IndexFileDeleter to deal with Windows file 
> systems that cannot delete still open files.
> And with LUCENE-6829, where OfflineSorter now must deal with the situation 
> too ... I worked around it by fixing all tests to disable the virus checker.
> I think it makes more sense to push this "platform specific problem" lower in 
> the stack, into Directory?  I.e., its deleteFile method would catch the 
> access denied, and then retry the deletion later.  Then we could re-enable 
> virus checker on all these tests, simplify IndexFileDeleter, etc.
> Maybe in the future we could further push this down, into WindowsDirectory,  
> and fix FSDirectory.open to return WindowsDirectory on windows ...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to