lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccurr...@apache.org
Subject svn commit: r1371742 - /incubator/lucene.net/trunk/src/core/Store/NativeFSLockFactory.cs
Date Fri, 10 Aug 2012 15:33:24 GMT
Author: ccurrens
Date: Fri Aug 10 15:33:24 2012
New Revision: 1371742

URL: http://svn.apache.org/viewvc?rev=1371742&view=rev
Log:
[LUCENENET-484] - Copy paste isn't so good.  A change from an earlier commit could cause a
NullReferenceException on catching a UnauthorizedAccessException.

Modified:
    incubator/lucene.net/trunk/src/core/Store/NativeFSLockFactory.cs

Modified: incubator/lucene.net/trunk/src/core/Store/NativeFSLockFactory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/src/core/Store/NativeFSLockFactory.cs?rev=1371742&r1=1371741&r2=1371742&view=diff
==============================================================================
--- incubator/lucene.net/trunk/src/core/Store/NativeFSLockFactory.cs (original)
+++ incubator/lucene.net/trunk/src/core/Store/NativeFSLockFactory.cs Fri Aug 10 15:33:24 2012
@@ -286,12 +286,16 @@ namespace Lucene.Net.Store
                             // lucene.net: UnauthorizedAccessException does not derive from
IOException like in java
                             catch (System.UnauthorizedAccessException e)
                             {
-                                // On Windows, we can get intermittent "Access
-                                // Denied" here.  So, we treat this as failure to
-                                // acquire the lock, but, store the reason in case
-                                // there is in fact a real error case.
+                                // At least on OS X, we will sometimes get an
+                                // intermittent "Permission Denied" IOException,
+                                // which seems to simply mean "you failed to get
+                                // the lock".  But other IOExceptions could be
+                                // "permanent" (eg, locking is not supported via
+                                // the filesystem).  So, we record the failure
+                                // reason here; the timeout obtain (usually the
+                                // one calling us) will use this as "root cause"
+                                // if it fails to get the lock.
                                 failureReason = e;
-                                f = null;
                             }
                             finally
                             {



Mime
View raw message