You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Michael Busch <bu...@gmail.com> on 2008/01/17 20:11:22 UTC
Re: svn commit: r612869 - in /lucene/java/branches/lucene_2_3: contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java
src/java/org/apache/lucene/store/SimpleFSLockFactory.java src/test/org/apache/lucene/store/TestLockFactory.java
Hi Grant,
do you think we need another RC today so that people can test this.
Otherwise I'll create a (hopefully) final RC end of tomorrow and call a
release vote.
-Michael
gsingers@apache.org wrote:
> Author: gsingers
> Date: Thu Jan 17 09:01:01 2008
> New Revision: 612869
>
> URL: http://svn.apache.org/viewvc?rev=612869&view=rev
> Log:
> LUCENE-1050 and LUCENE-1138 fixes for lock problem
>
> Modified:
> lucene/java/branches/lucene_2_3/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java
> lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/store/SimpleFSLockFactory.java
> lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/store/TestLockFactory.java
>
> Modified: lucene/java/branches/lucene_2_3/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java
> URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_3/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java?rev=612869&r1=612868&r2=612869&view=diff
> ==============================================================================
> --- lucene/java/branches/lucene_2_3/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java (original)
> +++ lucene/java/branches/lucene_2_3/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java Thu Jan 17 09:01:01 2008
> @@ -284,7 +284,9 @@
> * @throws IOException
> */
> public void clearIndex() throws IOException {
> - IndexReader.unlock(spellIndex);
> + if (IndexReader.isLocked(spellIndex)){
> + IndexReader.unlock(spellIndex);
> + }
> IndexWriter writer = new IndexWriter(spellIndex, null, true);
> writer.close();
> }
>
> Modified: lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/store/SimpleFSLockFactory.java
> URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/store/SimpleFSLockFactory.java?rev=612869&r1=612868&r2=612869&view=diff
> ==============================================================================
> --- lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/store/SimpleFSLockFactory.java (original)
> +++ lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/store/SimpleFSLockFactory.java Thu Jan 17 09:01:01 2008
> @@ -145,7 +145,7 @@
> }
>
> public void release() throws LockReleaseFailedException {
> - if (!lockFile.delete())
> + if (lockFile.exists() && !lockFile.delete())
> throw new LockReleaseFailedException("failed to delete " + lockFile);
> }
>
>
> Modified: lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/store/TestLockFactory.java
> URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/store/TestLockFactory.java?rev=612869&r1=612868&r2=612869&view=diff
> ==============================================================================
> --- lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/store/TestLockFactory.java (original)
> +++ lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/store/TestLockFactory.java Thu Jan 17 09:01:01 2008
> @@ -190,9 +190,9 @@
> if (writer2 != null) {
> try {
> writer2.close();
> - fail("writer2.close() should have hit LockReleaseFailedException");
> - } catch (LockReleaseFailedException e) {
> // expected
> + } catch (LockReleaseFailedException e) {
> + fail("writer2.close() should not have hit LockReleaseFailedException");
> }
> }
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: svn commit: r612869 - in /lucene/java/branches/lucene_2_3: contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java
src/java/org/apache/lucene/store/SimpleFSLockFactory.java src/test/org/apache/lucene/store/TestLockFactory.java
Posted by Michael Busch <bu...@gmail.com>.
Grant Ingersoll wrote:
>
> What do others think?
>
> I think I will say +1 to going ahead w/ the release.
>
I agree. The patch seems low-risk to me.
-Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: svn commit: r612869 - in /lucene/java/branches/lucene_2_3: contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java src/java/org/apache/lucene/store/SimpleFSLockFactory.java src/test/org/apache/lucene/store/TestLockFactory.java
Posted by Grant Ingersoll <gs...@apache.org>.
Hmmm. The functionality that caused the problem was introduced in
2.3, so 2.2 users would not be aware of it. I'm pretty confident it
is right, but...
I am definitely fine w/ the SpellChecker change, as it should have
been checking isLocked in the first place. The Lock stuff, I will
have to defer to those who know more about locking. Mike M. seemed to
be fine with it. The old code (pre 1050) just did a delete and never
checked the result. Thus, the only people who would notice the change
are those who are using trunk.
What do others think?
I think I will say +1 to going ahead w/ the release.
Out on a limb,
Grant
On Jan 17, 2008, at 2:11 PM, Michael Busch wrote:
> Hi Grant,
>
> do you think we need another RC today so that people can test this.
>
> Otherwise I'll create a (hopefully) final RC end of tomorrow and
> call a
> release vote.
>
> -Michael
>
>
> gsingers@apache.org wrote:
>> Author: gsingers
>> Date: Thu Jan 17 09:01:01 2008
>> New Revision: 612869
>>
>> URL: http://svn.apache.org/viewvc?rev=612869&view=rev
>> Log:
>> LUCENE-1050 and LUCENE-1138 fixes for lock problem
>>
>> Modified:
>> lucene/java/branches/lucene_2_3/contrib/spellchecker/src/java/
>> org/apache/lucene/search/spell/SpellChecker.java
>> lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/store/
>> SimpleFSLockFactory.java
>> lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/store/
>> TestLockFactory.java
>>
>> Modified: lucene/java/branches/lucene_2_3/contrib/spellchecker/src/
>> java/org/apache/lucene/search/spell/SpellChecker.java
>> URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_3/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java?rev=612869&r1=612868&r2=612869&view=diff
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- lucene/java/branches/lucene_2_3/contrib/spellchecker/src/java/
>> org/apache/lucene/search/spell/SpellChecker.java (original)
>> +++ lucene/java/branches/lucene_2_3/contrib/spellchecker/src/java/
>> org/apache/lucene/search/spell/SpellChecker.java Thu Jan 17
>> 09:01:01 2008
>> @@ -284,7 +284,9 @@
>> * @throws IOException
>> */
>> public void clearIndex() throws IOException {
>> - IndexReader.unlock(spellIndex);
>> + if (IndexReader.isLocked(spellIndex)){
>> + IndexReader.unlock(spellIndex);
>> + }
>> IndexWriter writer = new IndexWriter(spellIndex, null, true);
>> writer.close();
>> }
>>
>> Modified: lucene/java/branches/lucene_2_3/src/java/org/apache/
>> lucene/store/SimpleFSLockFactory.java
>> URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/store/SimpleFSLockFactory.java?rev=612869&r1=612868&r2=612869&view=diff
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/
>> store/SimpleFSLockFactory.java (original)
>> +++ lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/
>> store/SimpleFSLockFactory.java Thu Jan 17 09:01:01 2008
>> @@ -145,7 +145,7 @@
>> }
>>
>> public void release() throws LockReleaseFailedException {
>> - if (!lockFile.delete())
>> + if (lockFile.exists() && !lockFile.delete())
>> throw new LockReleaseFailedException("failed to delete " +
>> lockFile);
>> }
>>
>>
>> Modified: lucene/java/branches/lucene_2_3/src/test/org/apache/
>> lucene/store/TestLockFactory.java
>> URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/store/TestLockFactory.java?rev=612869&r1=612868&r2=612869&view=diff
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/
>> store/TestLockFactory.java (original)
>> +++ lucene/java/branches/lucene_2_3/src/test/org/apache/lucene/
>> store/TestLockFactory.java Thu Jan 17 09:01:01 2008
>> @@ -190,9 +190,9 @@
>> if (writer2 != null) {
>> try {
>> writer2.close();
>> - fail("writer2.close() should have hit
>> LockReleaseFailedException");
>> - } catch (LockReleaseFailedException e) {
>> // expected
>> + } catch (LockReleaseFailedException e) {
>> + fail("writer2.close() should not have hit
>> LockReleaseFailedException");
>> }
>> }
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
--------------------------
Grant Ingersoll
http://lucene.grantingersoll.com
http://www.lucenebootcamp.com
Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org