lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulir...@apache.org
Subject git commit: Fix bug in merged iterator, release IW lock upon exception
Date Fri, 08 Nov 2013 17:15:40 GMT
Updated Branches:
  refs/heads/branch_4x ee9d4da55 -> a7f1e236d


Fix bug in merged iterator, release IW lock upon exception


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/a7f1e236
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/a7f1e236
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/a7f1e236

Branch: refs/heads/branch_4x
Commit: a7f1e236da3ae532b602c4a7401c6b66fa48cc76
Parents: ee9d4da
Author: Paul Irwin <paulirwin@gmail.com>
Authored: Fri Nov 8 12:14:41 2013 -0500
Committer: Paul Irwin <paulirwin@gmail.com>
Committed: Fri Nov 8 12:14:41 2013 -0500

----------------------------------------------------------------------
 src/core/Index/IndexWriter.cs    | 7 +++++++
 src/core/Index/MergedIterator.cs | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a7f1e236/src/core/Index/IndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/IndexWriter.cs b/src/core/Index/IndexWriter.cs
index 99c1d33..90ce3e3 100644
--- a/src/core/Index/IndexWriter.cs
+++ b/src/core/Index/IndexWriter.cs
@@ -987,6 +987,13 @@ namespace Lucene.Net.Index
             }
             finally
             {
+                // paranoid double check
+                if (writeLock != null)
+                {
+                    writeLock.Release();                          // release write lock
+                    writeLock = null;
+                }
+
                 lock (this)
                 {
                     closing = false;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a7f1e236/src/core/Index/MergedIterator.cs
----------------------------------------------------------------------
diff --git a/src/core/Index/MergedIterator.cs b/src/core/Index/MergedIterator.cs
index c4dd048..457a83d 100644
--- a/src/core/Index/MergedIterator.cs
+++ b/src/core/Index/MergedIterator.cs
@@ -114,7 +114,7 @@ namespace Lucene.Net.Index
             // call next() on each top, and put back into queue
             for (int i = 0; i < numTop; i++)
             {
-                if (top[i].iterator.MoveNext())
+                if (top[i].iterator.Current != null)
                 {
                     top[i].current = top[i].iterator.Current;
                     queue.Add(top[i]);


Mime
View raw message