You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2012/07/11 01:06:08 UTC
svn commit: r1359946 - in /lucene/dev/trunk/lucene: CHANGES.txt
suggest/src/java/org/apache/lucene/search/suggest/fst/Sort.java
Author: rmuir
Date: Tue Jul 10 23:06:08 2012
New Revision: 1359946
URL: http://svn.apache.org/viewvc?rev=1359946&view=rev
Log:
LUCENE-4209: fix another suggester leak: dont leave behind the file when rename fails (/tmp is its own filesystem)
Modified:
lucene/dev/trunk/lucene/CHANGES.txt
lucene/dev/trunk/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/Sort.java
Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1359946&r1=1359945&r2=1359946&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Tue Jul 10 23:06:08 2012
@@ -45,7 +45,8 @@ Bug Fixes
* LUCENE-4209: Fix FSTCompletionLookup to close its sorter, so that it won't
leave temp files behind in /tmp. Fix SortedTermFreqIteratorWrapper to not
- leave temp files behind in /tmp on Windows. (Uwe Schindler, Robert Muir)
+ leave temp files behind in /tmp on Windows. Fix Sort to not leave
+ temp files behind when /tmp is a separate volume. (Uwe Schindler, Robert Muir)
Build
Modified: lucene/dev/trunk/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/Sort.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/Sort.java?rev=1359946&r1=1359945&r2=1359946&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/Sort.java (original)
+++ lucene/dev/trunk/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/Sort.java Tue Jul 10 23:06:08 2012
@@ -224,10 +224,12 @@ public final class Sort {
// One partition, try to rename or copy if unsuccessful.
if (merges.size() == 1) {
+ File single = merges.get(0);
// If simple rename doesn't work this means the output is
// on a different volume or something. Copy the input then.
- if (!merges.get(0).renameTo(output)) {
- copy(merges.get(0), output);
+ if (!single.renameTo(output)) {
+ copy(single, output);
+ single.delete();
}
} else {
// otherwise merge the partitions with a priority queue.