question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jraft-example benchmark client hang

See original GitHub issue

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)

https://github.com/sofastack/sofa-jraft/blob/f6d2e8053aa0e8e894ef18a988f4ea9812c36f95/jraft-example/src/main/java/com/alipay/sofa/jraft/benchmark/client/BenchmarkClient.java

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
JerryYangSHcommented, Mar 30, 2020

After I pull the code from latest master, the problem is gone! Thanks!

0reactions
JerryYangSHcommented, Mar 31, 2020

Finally I explicitely added protobuf dependency into jraft-example/pom.xml, now it works!

<dependency>
            <groupId>io.protostuff</groupId>
            <artifactId>protostuff-core</artifactId>
            <version>${protostuff.version}</version>
        </dependency>
        <dependency>
            <groupId>io.protostuff</groupId>
            <artifactId>protostuff-runtime</artifactId>
            <version>${protostuff.version}</version>
        </dependency>
Read more comments on GitHub >

github_iconTop Results From Across the Web

System hangs while running benchmark test with Timekeeper ...
Issue. We use the UnixBench toolkit to benchmark servers in our environment http://code.google.com/p/byte-unixbench/ One of the tests, ...
Read more >
benchmark hangs with non-integral RangeMultiplier #244
The following code hangs google/benchmark: BENCHMARK(BM_FibRecursive)->RangeMultiplier(1.6)->Range(1, 1<<5); There is no compiler warning, ...
Read more >
'ab' program freezes after lots of requests, why? - Stack Overflow
Whenever I use 'ab' to benchmark a web server, it will freeze for a while after having sent lots of requests, only to...
Read more >
Hold Times, Hang Ups, and Talk Times - DialogTech
How long are agents talking with customers? Talk times across all sizes averaged at 4 minutes and 29 seconds: How do you stack...
Read more >
Generating the Client Benchmark Report - Texas.gov
Welcome to the ImmTrac2 Training Video: Generating the Client Benchmark Report. The objectives of this video are to demonstrate how to configure and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found