[
https://issues.apache.org/jira/browse/RATIS-1889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17766020#comment-17766020
]
Tsz-wo Sze commented on RATIS-1889:
-----------------------------------
No clues. It does look like a JDK bug.
Tried to build it with Ozone. It did not have any problems in my machine.
{code}
+++ b/pom.xml
@@ -75,7 +75,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xs
<!-- HDDS Rocks Native dependency version-->
<hdds.rocks.native.version>${hdds.version}</hdds.rocks.native.version>
<!-- Apache Ratis version -->
- <ratis.version>2.5.1</ratis.version>
+ <ratis.version>2.5.2-284ecbb-SNAPSHOT</ratis.version>
<!-- Apache Ratis thirdparty version -->
<ratis.thirdparty.version>1.0.4</ratis.thirdparty.version>
szetszwo-mbp16:ozone-fork$java -version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
{code}
> NoSuchMethodError: RaftServerMetricsImpl.addNumPendingRequestsGauge
> -------------------------------------------------------------------
>
> Key: RATIS-1889
> URL: https://issues.apache.org/jira/browse/RATIS-1889
> Project: Ratis
> Issue Type: Bug
> Components: server
> Affects Versions: 2.5.1
> Reporter: Song Ziyang
> Priority: Major
>
>
> Error: Exception in thread "0@group-000100000001-LeaderElection10"
> java.lang.NoSuchMethodError:
> org.apache.ratis.server.metrics.RaftServerMetricsImpl.addNumPendingRequestsGauge(Ljava/util/function/Supplier;)V
> at
> org.apache.ratis.server.impl.PendingRequests$RequestMap.<init>(PendingRequests.java:115)
> at
> org.apache.ratis.server.impl.PendingRequests.<init>(PendingRequests.java:224)
> at
> org.apache.ratis.server.impl.LeaderStateImpl.<init>(LeaderStateImpl.java:341)
> at org.apache.ratis.server.impl.RoleInfo.updateLeaderState(RoleInfo.java:82)
> at
> org.apache.ratis.server.impl.RaftServerImpl.changeToLeader(RaftServerImpl.java:572)
> at org.apache.ratis.server.impl.LeaderElection.run(LeaderElection.java:248)
> 16212 at java.lang.Thread.run(Thread.java:750)
>
> The ratis jar was packaged after snapshot-branch2, commit
> 284ecbb25cb60a2ea3fde07fb71672fb122f53ac, using Oracle JDK 8u381 for Apple
> Silicon. It ran well on my local env (with JRE 8u381). However, it failed in
> github
> CI([https://github.com/apache/iotdb/actions/runs/6117648373/job/16604591720)]
> and [~tanxinyu]'s local computer (OpenJDK8 Zulu for Apple Silicon),
> {*}reproducible{*}.
>
> Previously I built ratis snapshot jars with x86 JDK 8 and everything worked
> just fine. I guess something goes wrong regarding Java Cross Platform
> Compatibility.
>
> Miraculously, if we change the method reference (resource::getMegaSizeByte)
> to lambda expression (() -> resource.getMegaSizeByte()), {*}the error goes
> away{*}.
> The semantics of method reference and lambda should be same (despite that
> they do differ in byte code).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)