[
https://issues.apache.org/jira/browse/LUCENE-6813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14906062#comment-14906062
]
Dawid Weiss commented on LUCENE-6813:
-------------------------------------
Hmm... I don't like the move of defaultTempDir() to a static initializer -- it
means if anything fails (property read, whatever) then you'd get an early
exception upon class linking which can be often be very confusing. I'd rather
have a lazy return as it was before.
{code}
+ // So all code using OfflineSorter (suggesters, BKD tree,
NumericRangeTree) see MockFS goodness, e.g. catching leaked file handles:
+ OfflineSorter.setDefaultTempDir(javaTempDir);
{code}
Wouldn't it be possible to set the {{java.io.tmpdir}} property to a path that
resolves to mockfs instead? Then any paths resolved from java.io.tmpdir would
be "wrapped" by MockFS, no matter where they originate from and without the
(dodgy) static test-only variable substitution methods... Don't know how hard
it'd be though.
> OfflineSorter.sort shouldn't remove the output Path up front
> ------------------------------------------------------------
>
> Key: LUCENE-6813
> URL: https://issues.apache.org/jira/browse/LUCENE-6813
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Michael McCandless
> Assignee: Michael McCandless
> Fix For: Trunk, 5.4
>
> Attachments: LUCENE-6813.patch, LUCENE-6813.patch
>
>
> The new BKD tree classes, and NumericRangeTree (just a 1D BKD tree),
> make heavy use of OfflineSorter to build their data structures at
> indexing time when the number of indexed documents is biggish.
> But when I was first building them (LUCENE-6477), I hit a thread
> safety issue in OfflineSorter, and at that time I just worked around
> it by creating my own private temp directory each time I need to write
> a BKD tree.
> This workaround is sort of messy, and it causes problems with "pending
> delete" files on Windows when we try to remove that temp directory,
> causing test failures like
> http://jenkins.thetaphi.de/job/Lucene-Solr-5.x-Windows/5149/
> I think instead we should fix the root cause ... i.e. make
> OfflineSorter thread safe. It looks like it's simple...
> Separately I'd like to somehow fix these BKD tests to catch any leaked
> file handles ... I'm not sure they are today.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]