hibernate-search icon indicating copy to clipboard operation
hibernate-search copied to clipboard

HSEARCH-5155 Build with JDK 21

Open yrodiere opened this issue 1 year ago • 3 comments

https://hibernate.atlassian.net/browse/HSEARCH-5155

yrodiere avatar May 22 '24 07:05 yrodiere

Looks nice 😃 thanks! Version in GH actions should probably be updated too 🙈

marko-bekhta avatar May 22 '24 07:05 marko-bekhta

Version in GH actions should probably be updated too 🙈

Right, sorry. Done.

yrodiere avatar May 22 '24 07:05 yrodiere

So... turns out this won't work because impsort maven plugin needs a release... see https://github.com/revelc/impsort-maven-plugin/pull/83. Moving to draft.

yrodiere avatar May 22 '24 07:05 yrodiere

Draft again... https://github.com/revelc/formatter-maven-plugin/issues/881

yrodiere avatar May 29 '24 11:05 yrodiere

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

I added an upgrade to formatter-maven-plugin 2.24.0, which supposedly solves the Java 21 compatibility problem... but then it has other problems, so we'll probably have to wait for 2.24.1 or 2.25.0 :(

yrodiere avatar Jun 03 '24 11:06 yrodiere

I added an upgrade to formatter-maven-plugin 2.24.0, which supposedly solves the Java 21 compatibility problem... but then it has other problems, so we'll probably have to wait for 2.24.1 or 2.25.0 :(

Alright, 2.24.1 is out, I updated the PR... and...

[ERROR] Failed to execute goal net.revelc.code:impsort-maven-plugin:1.10.0:sort (import-sorting) on project hibernate-search-parent-integrationtest: Execution import-sorting of goal net.revelc.code:impsort-maven-plugin:1.10.0:sort failed: No enum constant com.github.javaparser.ParserConfiguration.LanguageLevel.JAVA_21 -> [Help 1]

:facepalm:

https://github.com/revelc/impsort-maven-plugin/issues/101#issuecomment-2140991247

:cry:

yrodiere avatar Jun 05 '24 06:06 yrodiere

Added an upgrade to a version of impsort that supports JDK 21, and rebased.

:crossed_fingers:

yrodiere avatar Jun 27 '24 15:06 yrodiere

😖 😕 there seems to be some precision loss with JDK 21 switch... RangeAggregationSpecificsIT fails in this PR (but only on OpenSearch) as the upper bound on JDK 17 1.58451456E9 and on JDK 21 1.5845146E9 (56 gets rounded to just 6)

marko-bekhta avatar Jul 01 '24 16:07 marko-bekhta

This is very odd... If this is related to the jdk, I'd expect this to affect Elasticsearch as well... ? Or maybe there's some opensearch-specific testing or JSON handling at play?

Did you pinpoint where the precision loss occurs exactly? Compilation of a constant, or Jason parsing/formatting, or... ?

yrodiere avatar Jul 02 '24 08:07 yrodiere

yeah ... looking into this right now 🙈 that info I posted yesterday was by looking at the generated query string. I'll post here once I find something.

marko-bekhta avatar Jul 02 '24 13:07 marko-bekhta

https://bugs.openjdk.org/browse/JDK-8202555 https://bugs.openjdk.org/browse/JDK-8291475

^ looks like that's the reason 😕 I've tested with JDK 17 (ok) 18 (ok) 19 (not ok) and 21 (not ok) 😄 This "loss" happens inside of the JsonPrimitive when the query is sent. OpenSearch has a JDK 21 bundled while Elasticsearch has JDK 22. I've tried starting OpenSearch with JDK 22 just to see if that would make a difference, but no. I also tried running this test on OpenSearch 2.15 - 2.1 and got the same result on all.

I guess let's just update the test value and move on? ( 1584514514.000000184f -> 1584514414.000000184f )

marko-bekhta avatar Jul 02 '24 15:07 marko-bekhta

I guess let's just update the test value and move on? ( 1584514514.000000184f -> 1584514414.000000184f )

+1 if it's a jdk bug, and it's already been reported, not much we can do.

yrodiere avatar Jul 03 '24 06:07 yrodiere

The build passed! thanks 😃!

marko-bekhta avatar Jul 03 '24 10:07 marko-bekhta