sofa-jraft: jraft-example benchmark client hang
Describe the bug
When I run jraft-example test, it hangs at BenchmarkClient.main#rebalance, and the ‘startBenchmark’ test never starts.
The hang stack is below: “com.alipay.sofa.jraft.benchmark.BenchmarkBootstrap.main()” #12 prio=5 os_prio=0 tid=0x00007f4110d24000 nid=0x613d waiting on condition [0x00007f40f8d86000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at com.alipay.sofa.jraft.rhea.client.pd.AbstractPlacementDriverClient.getLeader(AbstractPlacementDriverClient.java:273) at com.alipay.sofa.jraft.rhea.client.pd.AbstractPlacementDriverClient.getLeader(AbstractPlacementDriverClient.java:237) at com.alipay.sofa.jraft.benchmark.client.BenchmarkClient.rebalance(BenchmarkClient.java:183) at com.alipay.sofa.jraft.benchmark.client.BenchmarkClient.main(BenchmarkClient.java:84) at com.alipay.sofa.jraft.benchmark.BenchmarkBootstrap.main(BenchmarkBootstrap.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282) at java.lang.Thread.run(Thread.java:748)
Expected behavior
The client should continue to startBenchmark.
Actual behavior
It blocks at rebalance in main.
Steps to reproduce
Run 3 servers of example on single node, and a client with below maven commands.
mvn -pl jraft-example exec:java -Dexec.mainClass=com.alipay.sofa.jraft.benchmark.server.BenchmarkServer -Dexec.args=“server 127.0.0.1:18091,127.0.0.1:18092,127.0.0.1:18093 jraft-example/config/benchmark_server1.yaml”
mvn -pl jraft-example exec:java -Dexec.mainClass=com.alipay.sofa.jraft.benchmark.server.BenchmarkServer -Dexec.args=“server 127.0.0.1:18091,127.0.0.1:18092,127.0.0.1:18093 jraft-example/config/benchmark_server2.yaml”
mvn -pl jraft-example exec:java -Dexec.mainClass=com.alipay.sofa.jraft.benchmark.server.BenchmarkServer -Dexec.args=“server 127.0.0.1:18091,127.0.0.1:18092,127.0.0.1:18093 jraft-example/config/benchmark_server3.yaml”
mvn -pl jraft-example exec:java -Dexec.mainClass=com.alipay.sofa.jraft.benchmark.client.BenchmarkClient -Dexec.args=“client 127.0.0.1:18091,127.0.0.1:18092,127.0.0.1:18093 jraft-example/config/benchmark_client.yaml 1 50 50 1024”
Minimal yet complete reproducer code (or GitHub URL to code)
Environment
- SOFAJRaft version: the latest master
- JVM version (e.g.
java -version
): 1.8.0_231
jerry@u19:~/opensources/sofa-jraft$ java -version Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Djava.library.path=/usr/local/lib java version “1.8.0_231” Java™ SE Runtime Environment (build 1.8.0_231-b11) Java HotSpot™ 64-Bit Server VM (build 25.231-b11, mixed mode)
- OS version (e.g.
uname -a
): Linux u19 5.0.0-38-generic #41-Ubuntu SMP Tue Dec 3 00:27:35 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux - Maven version: Apache Maven 3.6.0
- IDE version: No IDEA. Linux bash
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (7 by maintainers)
After I pull the code from latest master, the problem is gone! Thanks!