You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by sy...@apache.org on 2015/01/06 14:24:50 UTC

[1/4] lucenenet git commit: fsync for directories on windows does not make sense

Repository: lucenenet
Updated Branches:
  refs/heads/master f09cd685e -> f7cc217ff


fsync for directories on windows does not make sense


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

Branch: refs/heads/master
Commit: 7b8256c61f195c73a9ef071a3ac30a40f148daac
Parents: 67f47ad
Author: Laimonas Simutis <la...@gmail.com>
Authored: Sun Jan 4 21:59:02 2015 -0500
Committer: Laimonas Simutis <la...@gmail.com>
Committed: Sun Jan 4 21:59:02 2015 -0500

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/IOUtils.cs | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/7b8256c6/src/Lucene.Net.Core/Util/IOUtils.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/IOUtils.cs b/src/Lucene.Net.Core/Util/IOUtils.cs
index e23d3cd..581eb61 100644
--- a/src/Lucene.Net.Core/Util/IOUtils.cs
+++ b/src/Lucene.Net.Core/Util/IOUtils.cs
@@ -443,6 +443,12 @@ namespace Lucene.Net.Util
         ///  because not all file systems and operating systems allow to fsync on a directory) </param>
         public static void Fsync(string fileToSync, bool isDir)
         {
+            // Fsync for folders appears to be "undefined" for Windows platform based on the blog article in the comments below
+            if (isDir && Constants.WINDOWS)
+            {
+                return;
+            }
+
             var retryCount = 1;
             while (true)
             {


[4/4] lucenenet git commit: Merge remote-tracking branch 'laimis/IOUtils_fix'

Posted by sy...@apache.org.
Merge remote-tracking branch 'laimis/IOUtils_fix'


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

Branch: refs/heads/master
Commit: f7cc217ff1dc16cb470aabf5989e7e0006f0f386
Parents: f09cd68 c299699
Author: Itamar Syn-Hershko <it...@code972.com>
Authored: Tue Jan 6 15:24:07 2015 +0200
Committer: Itamar Syn-Hershko <it...@code972.com>
Committed: Tue Jan 6 15:24:07 2015 +0200

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/IOUtils.cs | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f7cc217f/src/Lucene.Net.Core/Util/IOUtils.cs
----------------------------------------------------------------------


Re: [2/4] lucenenet git commit: ignore fsync for directory completely

Posted by Itamar Syn-Hershko <it...@code972.com>.
This is still to be discussed and tested thoroughly, lets first stabilize
the rest of the test and then start running concurrent tests with proper
crashes etc (or at least make sure the Mock framework used does its job
properly)

--

Itamar Syn-Hershko
http://code972.com | @synhershko <https://twitter.com/synhershko>
Freelance Developer & Consultant
Author of RavenDB in Action <http://manning.com/synhershko/>

On Tue, Jan 6, 2015 at 3:24 PM, <sy...@apache.org> wrote:

> ignore fsync for directory completely
>
>
> Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
> Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/1c1fc88c
> Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/1c1fc88c
> Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/1c1fc88c
>
> Branch: refs/heads/master
> Commit: 1c1fc88ce879610f4efa5788c74281bf739563f9
> Parents: 7b8256c
> Author: Laimonas Simutis <la...@gmail.com>
> Authored: Mon Jan 5 17:21:58 2015 -0500
> Committer: Laimonas Simutis <la...@gmail.com>
> Committed: Mon Jan 5 17:21:58 2015 -0500
>
> ----------------------------------------------------------------------
>  src/Lucene.Net.Core/Util/IOUtils.cs | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1c1fc88c/src/Lucene.Net.Core/Util/IOUtils.cs
> ----------------------------------------------------------------------
> diff --git a/src/Lucene.Net.Core/Util/IOUtils.cs
> b/src/Lucene.Net.Core/Util/IOUtils.cs
> index 581eb61..6147c4a 100644
> --- a/src/Lucene.Net.Core/Util/IOUtils.cs
> +++ b/src/Lucene.Net.Core/Util/IOUtils.cs
> @@ -443,8 +443,11 @@ namespace Lucene.Net.Util
>          ///  because not all file systems and operating systems allow to
> fsync on a directory) </param>
>          public static void Fsync(string fileToSync, bool isDir)
>          {
> -            // Fsync for folders appears to be "undefined" for Windows
> platform based on the blog article in the comments below
> -            if (isDir && Constants.WINDOWS)
> +            // Fsync does not appear to function properly for Windows and
> Linux platforms. In Lucene version
> +            // they catch this in IOException branch and return if the
> call is for the directory.
> +            // In Lucene.Net the exception is UnauthorizedAccessException
> and is not handled by
> +            // IOException block. No need to even attempt to fsync, just
> return if the call is for directory
> +            if (isDir)
>              {
>                  return;
>              }
> @@ -468,16 +471,10 @@ namespace Lucene.Net.Util
>                      }
>                      catch (IOException e)
>                      {
> -                        if (isDir)
> -                        {
> -                            Debug.Assert((Constants.LINUX ||
> Constants.MAC_OS_X) == false,
> -                                "On Linux and MacOSX fsyncing a directory
> should not throw IOException, " +
> -                                "we just don't want to rely on that in
> production (undocumented). Got: " + e); // Ignore exception if it is a
> directory
> -                            return;
> -                        }
> -
>                          if (retryCount == 5)
> +                        {
>                              throw;
> +                        }
>
>                          // Pause 5 msec
>                          Thread.Sleep(5);
>
>

[2/4] lucenenet git commit: ignore fsync for directory completely

Posted by sy...@apache.org.
ignore fsync for directory completely


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

Branch: refs/heads/master
Commit: 1c1fc88ce879610f4efa5788c74281bf739563f9
Parents: 7b8256c
Author: Laimonas Simutis <la...@gmail.com>
Authored: Mon Jan 5 17:21:58 2015 -0500
Committer: Laimonas Simutis <la...@gmail.com>
Committed: Mon Jan 5 17:21:58 2015 -0500

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/IOUtils.cs | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/1c1fc88c/src/Lucene.Net.Core/Util/IOUtils.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/IOUtils.cs b/src/Lucene.Net.Core/Util/IOUtils.cs
index 581eb61..6147c4a 100644
--- a/src/Lucene.Net.Core/Util/IOUtils.cs
+++ b/src/Lucene.Net.Core/Util/IOUtils.cs
@@ -443,8 +443,11 @@ namespace Lucene.Net.Util
         ///  because not all file systems and operating systems allow to fsync on a directory) </param>
         public static void Fsync(string fileToSync, bool isDir)
         {
-            // Fsync for folders appears to be "undefined" for Windows platform based on the blog article in the comments below
-            if (isDir && Constants.WINDOWS)
+            // Fsync does not appear to function properly for Windows and Linux platforms. In Lucene version
+            // they catch this in IOException branch and return if the call is for the directory. 
+            // In Lucene.Net the exception is UnauthorizedAccessException and is not handled by
+            // IOException block. No need to even attempt to fsync, just return if the call is for directory
+            if (isDir)
             {
                 return;
             }
@@ -468,16 +471,10 @@ namespace Lucene.Net.Util
                     }
                     catch (IOException e)
                     {
-                        if (isDir)
-                        {
-                            Debug.Assert((Constants.LINUX || Constants.MAC_OS_X) == false,
-                                "On Linux and MacOSX fsyncing a directory should not throw IOException, " +
-                                "we just don't want to rely on that in production (undocumented). Got: " + e); // Ignore exception if it is a directory
-                            return;
-                        }
-
                         if (retryCount == 5)
+                        {
                             throw;
+                        }
 
                         // Pause 5 msec
                         Thread.Sleep(5);


[3/4] lucenenet git commit: Merge https://github.com/apache/lucenenet into IOUtils_fix

Posted by sy...@apache.org.
Merge https://github.com/apache/lucenenet into IOUtils_fix


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

Branch: refs/heads/master
Commit: c299699801ff2abfb932997075c6addf1a5cb05a
Parents: 1c1fc88 b18ae0a
Author: Laimonas Simutis <la...@gmail.com>
Authored: Mon Jan 5 17:23:58 2015 -0500
Committer: Laimonas Simutis <la...@gmail.com>
Committed: Mon Jan 5 17:23:58 2015 -0500

----------------------------------------------------------------------
 src/Lucene.Net.Core/Support/Inflater.cs         |  4 +-
 .../Attributes/AwaitsFixAttribute.cs            | 19 ++++++++
 .../Attributes/NightlyAttribute.cs              | 14 ++++++
 .../Attributes/WeeklyAttribute.cs               | 14 ++++++
 .../Index/BaseStoredFieldsFormatTestCase.cs     |  4 +-
 .../Index/BaseTermVectorsFormatTestCase.cs      |  3 +-
 .../Lucene.Net.TestFramework.csproj             |  3 ++
 .../Util/LuceneTestCase.cs                      | 49 +-------------------
 .../core/Index/Test2BPostings.cs                |  4 +-
 .../core/Index/TestIndexWriterDelete.cs         |  4 +-
 .../core/Store/TestDirectory.cs                 |  4 +-
 .../core/Store/TestHugeRamFile.cs               | 11 +++--
 .../core/Store/TestLockFactory.cs               |  8 ++--
 13 files changed, 71 insertions(+), 70 deletions(-)
----------------------------------------------------------------------