Mailing List Archive

Re: [lucene] branch branch_9x updated: Fix issues with BP tests and the security manager. (#12568)
Looks like Java 11 can't compile this, see
https://github.com/apache/lucene/actions/runs/6232257025/job/16915121779#step:5:452

/home/runner/work/lucene/lucene/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java:78:
error: bad use of '>'

 *     p -> new ForkJoinWorkerThread(p) {}, null, random().nextBoolean());
> Task :lucene:misc:compileJava FAILED
          ^
Note:
/home/runner/work/lucene/lucene/lucene/misc/src/java/org/apache/lucene/misc/util/fst/UpToTwoPositiveIntOutputs.java
uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
Note: Some input files use or override a deprecated API.

Not sure what's wrong, I think the problem is with the anonymous
subclassing.... Maybe brackets around the whole "new ForkJoin....() {}"
helps?

Uwe

Am 19.09.2023 um 09:04 schrieb jpountz@apache.org:
> This is an automated email from the ASF dual-hosted git repository.
>
> jpountz pushed a commit to branch branch_9x
> in repository https://gitbox.apache.org/repos/asf/lucene.git
>
>
> The following commit(s) were added to refs/heads/branch_9x by this push:
> new c241ab006c4 Fix issues with BP tests and the security manager. (#12568)
> c241ab006c4 is described below
>
> commit c241ab006c4be918207adc69bb34fa72a48286f3
> Author: Adrien Grand <jpountz@gmail.com>
> AuthorDate: Tue Sep 19 08:55:48 2023 +0200
>
> Fix issues with BP tests and the security manager. (#12568)
>
> The default ForkJoinPool implementation uses a thread factory that removes all
> permissions on threads, so we need to create our own to avoid tests failing
> with FS-based directories.
> ---
> .../src/java/org/apache/lucene/misc/index/BPIndexReorderer.java | 4 +++-
> .../test/org/apache/lucene/misc/index/TestBPIndexReorderer.java | 7 ++++++-
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java b/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java
> index 7482e7a06ed..b8dadc3f6a0 100644
> --- a/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java
> +++ b/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java
> @@ -74,7 +74,9 @@ import org.apache.lucene.util.OfflineSorter.BufferSize;
> *
> * Directory targetDir = FSDirectory.open(targetPath);
> * BPIndexReorderer reorderer = new BPIndexReorderer();
> - * reorderer.setForkJoinPool(ForkJoinPool.commonPool());
> + * ForkJoinPool pool = new ForkJoinPool(Runtime.getRuntime().availableProcessors(),
> + * p -> new ForkJoinWorkerThread(p) {}, null, random().nextBoolean());
> + * reorderer.setForkJoinPool(pool);
> * reorderer.setFields(Collections.singleton("body"));
> * CodecReader reorderedReaderView = reorderer.reorder(SlowCodecReaderWrapper.wrap(reader), targetDir);
> * try (IndexWriter w = new IndexWriter(targetDir, new IndexWriterConfig().setOpenMode(OpenMode.CREATE))) {
> diff --git a/lucene/misc/src/test/org/apache/lucene/misc/index/TestBPIndexReorderer.java b/lucene/misc/src/test/org/apache/lucene/misc/index/TestBPIndexReorderer.java
> index 4b6a9a85037..13d6989ff74 100644
> --- a/lucene/misc/src/test/org/apache/lucene/misc/index/TestBPIndexReorderer.java
> +++ b/lucene/misc/src/test/org/apache/lucene/misc/index/TestBPIndexReorderer.java
> @@ -21,6 +21,7 @@ import static org.apache.lucene.misc.index.BPIndexReorderer.fastLog2;
> import java.io.IOException;
> import java.util.Arrays;
> import java.util.concurrent.ForkJoinPool;
> +import java.util.concurrent.ForkJoinWorkerThread;
> import org.apache.lucene.document.Document;
> import org.apache.lucene.document.Field.Store;
> import org.apache.lucene.document.StoredField;
> @@ -47,7 +48,11 @@ public class TestBPIndexReorderer extends LuceneTestCase {
>
> public void testSingleTermWithForkJoinPool() throws IOException {
> int concurrency = TestUtil.nextInt(random(), 1, 8);
> - ForkJoinPool pool = new ForkJoinPool(concurrency);
> + // The default ForkJoinPool implementation uses a thread factory that removes all permissions on
> + // threads, so we need to create our own to avoid tests failing with FS-based directories.
> + ForkJoinPool pool =
> + new ForkJoinPool(
> + concurrency, p -> new ForkJoinWorkerThread(p) {}, null, random().nextBoolean());
> try {
> doTestSingleTerm(pool);
> } finally {
>
--
Uwe Schindler
Achterdiek 19, D-28357 Bremen
https://www.thetaphi.de
eMail: uwe@thetaphi.de


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: [lucene] branch branch_9x updated: Fix issues with BP tests and the security manager. (#12568) [ In reply to ]
I know where it comes from. The javadoc comment has a "<" sign.

I would also fix this in main.

Am 19.09.2023 um 09:48 schrieb Uwe Schindler:
> Looks like Java 11 can't compile this, see
> https://github.com/apache/lucene/actions/runs/6232257025/job/16915121779#step:5:452
>
> /home/runner/work/lucene/lucene/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java:78:
> error: bad use of '>'
>
>  *     p -> new ForkJoinWorkerThread(p) {}, null,
> random().nextBoolean());
> > Task :lucene:misc:compileJava FAILED
>           ^
> Note:
> /home/runner/work/lucene/lucene/lucene/misc/src/java/org/apache/lucene/misc/util/fst/UpToTwoPositiveIntOutputs.java
> uses or overrides a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> 1 error
> Note: Some input files use or override a deprecated API.
>
> Not sure what's wrong, I think the problem is with the anonymous
> subclassing.... Maybe brackets around the whole "new ForkJoin....()
> {}" helps?
>
> Uwe
>
> Am 19.09.2023 um 09:04 schrieb jpountz@apache.org:
>> This is an automated email from the ASF dual-hosted git repository.
>>
>> jpountz pushed a commit to branch branch_9x
>> in repository https://gitbox.apache.org/repos/asf/lucene.git
>>
>>
>> The following commit(s) were added to refs/heads/branch_9x by this push:
>>       new c241ab006c4 Fix issues with BP tests and the security
>> manager. (#12568)
>> c241ab006c4 is described below
>>
>> commit c241ab006c4be918207adc69bb34fa72a48286f3
>> Author: Adrien Grand <jpountz@gmail.com>
>> AuthorDate: Tue Sep 19 08:55:48 2023 +0200
>>
>>      Fix issues with BP tests and the security manager. (#12568)
>>           The default ForkJoinPool implementation uses a thread
>> factory that removes all
>>      permissions on threads, so we need to create our own to avoid
>> tests failing
>>      with FS-based directories.
>> ---
>> .../src/java/org/apache/lucene/misc/index/BPIndexReorderer.java | 4 +++-
>> .../test/org/apache/lucene/misc/index/TestBPIndexReorderer.java | 7
>> ++++++-
>>   2 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git
>> a/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java
>> b/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java
>>
>> index 7482e7a06ed..b8dadc3f6a0 100644
>> ---
>> a/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java
>> +++
>> b/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java
>> @@ -74,7 +74,9 @@ import
>> org.apache.lucene.util.OfflineSorter.BufferSize;
>>    *
>>    * Directory targetDir = FSDirectory.open(targetPath);
>>    * BPIndexReorderer reorderer = new BPIndexReorderer();
>> - * reorderer.setForkJoinPool(ForkJoinPool.commonPool());
>> + * ForkJoinPool pool = new
>> ForkJoinPool(Runtime.getRuntime().availableProcessors(),
>> + *     p -> new ForkJoinWorkerThread(p) {}, null,
>> random().nextBoolean());
>> + * reorderer.setForkJoinPool(pool);
>>    * reorderer.setFields(Collections.singleton("body"));
>>    * CodecReader reorderedReaderView =
>> reorderer.reorder(SlowCodecReaderWrapper.wrap(reader), targetDir);
>>    * try (IndexWriter w = new IndexWriter(targetDir, new
>> IndexWriterConfig().setOpenMode(OpenMode.CREATE))) {
>> diff --git
>> a/lucene/misc/src/test/org/apache/lucene/misc/index/TestBPIndexReorderer.java
>> b/lucene/misc/src/test/org/apache/lucene/misc/index/TestBPIndexReorderer.java
>>
>> index 4b6a9a85037..13d6989ff74 100644
>> ---
>> a/lucene/misc/src/test/org/apache/lucene/misc/index/TestBPIndexReorderer.java
>> +++
>> b/lucene/misc/src/test/org/apache/lucene/misc/index/TestBPIndexReorderer.java
>> @@ -21,6 +21,7 @@ import static
>> org.apache.lucene.misc.index.BPIndexReorderer.fastLog2;
>>   import java.io.IOException;
>>   import java.util.Arrays;
>>   import java.util.concurrent.ForkJoinPool;
>> +import java.util.concurrent.ForkJoinWorkerThread;
>>   import org.apache.lucene.document.Document;
>>   import org.apache.lucene.document.Field.Store;
>>   import org.apache.lucene.document.StoredField;
>> @@ -47,7 +48,11 @@ public class TestBPIndexReorderer extends
>> LuceneTestCase {
>>       public void testSingleTermWithForkJoinPool() throws IOException {
>>       int concurrency = TestUtil.nextInt(random(), 1, 8);
>> -    ForkJoinPool pool = new ForkJoinPool(concurrency);
>> +    // The default ForkJoinPool implementation uses a thread factory
>> that removes all permissions on
>> +    // threads, so we need to create our own to avoid tests failing
>> with FS-based directories.
>> +    ForkJoinPool pool =
>> +        new ForkJoinPool(
>> +            concurrency, p -> new ForkJoinWorkerThread(p) {}, null,
>> random().nextBoolean());
>>       try {
>>         doTestSingleTerm(pool);
>>       } finally {
>>
--
Uwe Schindler
Achterdiek 19, D-28357 Bremen
https://www.thetaphi.de
eMail: uwe@thetaphi.de


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
Re: [lucene] branch branch_9x updated: Fix issues with BP tests and the security manager. (#12568) [ In reply to ]
Tricky problem that only gets detected withyJava 11! It should be
fixed now on main and branch_9x.

Patrick, I think you should feel free to cut the branch, if there's
any other problem I will still be able to backport fixes to the newly
created branch.

On Tue, Sep 19, 2023 at 9:52?AM Uwe Schindler <uwe@thetaphi.de> wrote:
>
> I know where it comes from. The javadoc comment has a "<" sign.
>
> I would also fix this in main.
>
> Am 19.09.2023 um 09:48 schrieb Uwe Schindler:
> > Looks like Java 11 can't compile this, see
> > https://github.com/apache/lucene/actions/runs/6232257025/job/16915121779#step:5:452
> >
> > /home/runner/work/lucene/lucene/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java:78:
> > error: bad use of '>'
> >
> > * p -> new ForkJoinWorkerThread(p) {}, null,
> > random().nextBoolean());
> > > Task :lucene:misc:compileJava FAILED
> > ^
> > Note:
> > /home/runner/work/lucene/lucene/lucene/misc/src/java/org/apache/lucene/misc/util/fst/UpToTwoPositiveIntOutputs.java
> > uses or overrides a deprecated API.
> > Note: Recompile with -Xlint:deprecation for details.
> > 1 error
> > Note: Some input files use or override a deprecated API.
> >
> > Not sure what's wrong, I think the problem is with the anonymous
> > subclassing.... Maybe brackets around the whole "new ForkJoin....()
> > {}" helps?
> >
> > Uwe
> >
> > Am 19.09.2023 um 09:04 schrieb jpountz@apache.org:
> >> This is an automated email from the ASF dual-hosted git repository.
> >>
> >> jpountz pushed a commit to branch branch_9x
> >> in repository https://gitbox.apache.org/repos/asf/lucene.git
> >>
> >>
> >> The following commit(s) were added to refs/heads/branch_9x by this push:
> >> new c241ab006c4 Fix issues with BP tests and the security
> >> manager. (#12568)
> >> c241ab006c4 is described below
> >>
> >> commit c241ab006c4be918207adc69bb34fa72a48286f3
> >> Author: Adrien Grand <jpountz@gmail.com>
> >> AuthorDate: Tue Sep 19 08:55:48 2023 +0200
> >>
> >> Fix issues with BP tests and the security manager. (#12568)
> >> The default ForkJoinPool implementation uses a thread
> >> factory that removes all
> >> permissions on threads, so we need to create our own to avoid
> >> tests failing
> >> with FS-based directories.
> >> ---
> >> .../src/java/org/apache/lucene/misc/index/BPIndexReorderer.java | 4 +++-
> >> .../test/org/apache/lucene/misc/index/TestBPIndexReorderer.java | 7
> >> ++++++-
> >> 2 files changed, 9 insertions(+), 2 deletions(-)
> >>
> >> diff --git
> >> a/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java
> >> b/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java
> >>
> >> index 7482e7a06ed..b8dadc3f6a0 100644
> >> ---
> >> a/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java
> >> +++
> >> b/lucene/misc/src/java/org/apache/lucene/misc/index/BPIndexReorderer.java
> >> @@ -74,7 +74,9 @@ import
> >> org.apache.lucene.util.OfflineSorter.BufferSize;
> >> *
> >> * Directory targetDir = FSDirectory.open(targetPath);
> >> * BPIndexReorderer reorderer = new BPIndexReorderer();
> >> - * reorderer.setForkJoinPool(ForkJoinPool.commonPool());
> >> + * ForkJoinPool pool = new
> >> ForkJoinPool(Runtime.getRuntime().availableProcessors(),
> >> + * p -> new ForkJoinWorkerThread(p) {}, null,
> >> random().nextBoolean());
> >> + * reorderer.setForkJoinPool(pool);
> >> * reorderer.setFields(Collections.singleton("body"));
> >> * CodecReader reorderedReaderView =
> >> reorderer.reorder(SlowCodecReaderWrapper.wrap(reader), targetDir);
> >> * try (IndexWriter w = new IndexWriter(targetDir, new
> >> IndexWriterConfig().setOpenMode(OpenMode.CREATE))) {
> >> diff --git
> >> a/lucene/misc/src/test/org/apache/lucene/misc/index/TestBPIndexReorderer.java
> >> b/lucene/misc/src/test/org/apache/lucene/misc/index/TestBPIndexReorderer.java
> >>
> >> index 4b6a9a85037..13d6989ff74 100644
> >> ---
> >> a/lucene/misc/src/test/org/apache/lucene/misc/index/TestBPIndexReorderer.java
> >> +++
> >> b/lucene/misc/src/test/org/apache/lucene/misc/index/TestBPIndexReorderer.java
> >> @@ -21,6 +21,7 @@ import static
> >> org.apache.lucene.misc.index.BPIndexReorderer.fastLog2;
> >> import java.io.IOException;
> >> import java.util.Arrays;
> >> import java.util.concurrent.ForkJoinPool;
> >> +import java.util.concurrent.ForkJoinWorkerThread;
> >> import org.apache.lucene.document.Document;
> >> import org.apache.lucene.document.Field.Store;
> >> import org.apache.lucene.document.StoredField;
> >> @@ -47,7 +48,11 @@ public class TestBPIndexReorderer extends
> >> LuceneTestCase {
> >> public void testSingleTermWithForkJoinPool() throws IOException {
> >> int concurrency = TestUtil.nextInt(random(), 1, 8);
> >> - ForkJoinPool pool = new ForkJoinPool(concurrency);
> >> + // The default ForkJoinPool implementation uses a thread factory
> >> that removes all permissions on
> >> + // threads, so we need to create our own to avoid tests failing
> >> with FS-based directories.
> >> + ForkJoinPool pool =
> >> + new ForkJoinPool(
> >> + concurrency, p -> new ForkJoinWorkerThread(p) {}, null,
> >> random().nextBoolean());
> >> try {
> >> doTestSingleTerm(pool);
> >> } finally {
> >>
> --
> Uwe Schindler
> Achterdiek 19, D-28357 Bremen
> https://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>


--
Adrien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org