You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2024/12/11 07:36:11 UTC

(lucene) branch branch_10x updated (4cdb67329fb -> 559c4664eac)

This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a change to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git


    from 4cdb67329fb Revert "Refactor dummy scorables. (#14046)"
     new 1d370a9fd84 IndexInput.isLoaded seems to return false for mmap index inputs on Windows #14050 (#14053)
     new 559c4664eac Add github on-commit tests on MacOS and Windows (#14054)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/run-checks-all.yml                        | 13 +++++++++----
 .../org/apache/lucene/store/MemorySegmentIndexInput.java    | 13 +++++++++++--
 .../apache/lucene/tests/store/BaseDirectoryTestCase.java    |  6 +++++-
 3 files changed, 25 insertions(+), 7 deletions(-)


(lucene) 02/02: Add github on-commit tests on MacOS and Windows (#14054)

Posted by dw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 559c4664eac88030617ca8f28a1cd76681190688
Author: Dawid Weiss <da...@carrotsearch.com>
AuthorDate: Tue Dec 10 20:19:28 2024 +0100

    Add github on-commit tests on MacOS and Windows (#14054)
---
 .github/workflows/run-checks-all.yml | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/run-checks-all.yml b/.github/workflows/run-checks-all.yml
index 1bc0a0b564b..18dd308e9a7 100644
--- a/.github/workflows/run-checks-all.yml
+++ b/.github/workflows/run-checks-all.yml
@@ -34,11 +34,14 @@ jobs:
     runs-on: ${{ matrix.os }}
 
     steps:
+      - name: Correct git autocrlf
+        run: git config --global core.autocrlf false
+
       - uses: actions/checkout@v4
       - uses: ./.github/actions/prepare-for-build
 
       - name: Run gradle check (without tests)
-        run: ./gradlew check -x test -Ptask.times=true --max-workers 2
+        run: ./gradlew check -x test "-Ptask.times=true" --max-workers 2
 
 
   # This runs all tests without any other validation checks.
@@ -49,14 +52,16 @@ jobs:
     strategy:
       matrix:
         # Operating systems to run on.
-        # windows-latest: fairly slow to build and results in odd errors (see LUCENE-10167)
-        # macos-latest: a tad slower than ubuntu and pretty much the same (?) so leaving out.
-        os: [ ubuntu-latest ]
+        os: [ ubuntu-latest, windows-latest, macos-latest ]
         java: [ '21' ]
 
     runs-on: ${{ matrix.os }}
 
     steps:
+      - name: Correct git autocrlf on Windows
+        if: startsWith(matrix.os, 'windows')
+        run: git config --global core.autocrlf false
+
       - uses: actions/checkout@v4
       - uses: ./.github/actions/prepare-for-build
 


(lucene) 01/02: IndexInput.isLoaded seems to return false for mmap index inputs on Windows #14050 (#14053)

Posted by dw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 1d370a9fd84de2896c7c0dc5567f729dde79e526
Author: Dawid Weiss <da...@carrotsearch.com>
AuthorDate: Tue Dec 10 19:26:18 2024 +0100

    IndexInput.isLoaded seems to return false for mmap index inputs on Windows #14050 (#14053)
---
 .../org/apache/lucene/store/MemorySegmentIndexInput.java    | 13 +++++++++++--
 .../apache/lucene/tests/store/BaseDirectoryTestCase.java    |  6 +++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/lucene/core/src/java21/org/apache/lucene/store/MemorySegmentIndexInput.java b/lucene/core/src/java21/org/apache/lucene/store/MemorySegmentIndexInput.java
index 2fc9f6369b7..2424b53645b 100644
--- a/lucene/core/src/java21/org/apache/lucene/store/MemorySegmentIndexInput.java
+++ b/lucene/core/src/java21/org/apache/lucene/store/MemorySegmentIndexInput.java
@@ -27,6 +27,7 @@ import java.util.Objects;
 import java.util.Optional;
 import org.apache.lucene.util.ArrayUtil;
 import org.apache.lucene.util.BitUtil;
+import org.apache.lucene.util.Constants;
 import org.apache.lucene.util.GroupVIntUtil;
 import org.apache.lucene.util.IOConsumer;
 
@@ -422,12 +423,20 @@ abstract class MemorySegmentIndexInput extends IndexInput
 
   @Override
   public Optional<Boolean> isLoaded() {
+    boolean isLoaded = true;
     for (MemorySegment seg : segments) {
       if (seg.isLoaded() == false) {
-        return Optional.of(Boolean.FALSE);
+        isLoaded = false;
+        break;
       }
     }
-    return Optional.of(Boolean.TRUE);
+
+    if (Constants.WINDOWS && isLoaded == false) {
+      // see https://github.com/apache/lucene/issues/14050
+      return Optional.empty();
+    }
+
+    return Optional.of(isLoaded);
   }
 
   @Override
diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseDirectoryTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseDirectoryTestCase.java
index d8ec0529b5f..6defa5eb8c7 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseDirectoryTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/tests/store/BaseDirectoryTestCase.java
@@ -63,6 +63,7 @@ import org.apache.lucene.tests.util.LuceneTestCase;
 import org.apache.lucene.tests.util.TestUtil;
 import org.apache.lucene.util.ArrayUtil;
 import org.apache.lucene.util.BitUtil;
+import org.apache.lucene.util.Constants;
 import org.apache.lucene.util.GroupVIntUtil;
 import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.packed.PackedInts;
@@ -1667,7 +1668,10 @@ public abstract class BaseDirectoryTestCase extends LuceneTestCase {
           in = orig.slice("slice", startOffset, totalLength - startOffset);
         }
         var loaded = in.isLoaded();
-        if (FilterDirectory.unwrap(dir) instanceof MMapDirectory
+
+        if (Constants.WINDOWS) {
+          // On Windows, we temporarily don't care until this is fixed: #14050
+        } else if (FilterDirectory.unwrap(dir) instanceof MMapDirectory
             // direct IO wraps MMap but does not support isLoaded
             && !(dir.getClass().getName().contains("DirectIO"))) {
           assertTrue(loaded.isPresent());