Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-1889

NoSuchMethodError: RaftServerMetricsImpl.addNumPendingRequestsGauge

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.5.1
    • 3.0.0
    • server
    • None

    Description

       
      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). 

      Attachments

        Issue Links

          Activity

            People

              tanxinyu Xinyu Tan
              William Song Song Ziyang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h