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.

Detecting connection errors

See original GitHub issue

Hi!

What is the correct way to do KV requests with a timeout? The client seems to retry forever (jetcd 0.5.10). My code looks like this:

Client etcd = Client.builder()
        .endpoints("http://127.0.0.1:2379")
        .connectTimeout(Duration.ofSeconds(1))
        .build();

CountDownLatch countDownLatch = new CountDownLatch(1);
etcd.getKVClient()
        .get(ByteSequence.from("/x", StandardCharsets.UTF_8))
        .whenComplete((response, throwable) -> {
            if (throwable != null) {
                throwable.printStackTrace();
            }

            System.out.println("response = " + response);
            countDownLatch.countDown();
        });

countDownLatch.await();
System.out.println("done");

If I run this code without ectd running, it will never terminate. I’ve tried different retry options to the client builder but I can’t get it to work.

Thanks, Anton

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
lburgazzolicommented, Oct 28, 2021

I’ll do it today or tomorrow

On Thu, 28 Oct 2021 at 11:32, Anton Lindström @.***> wrote:

Hi!

Any updates on when this can be released? 😃

Thanks Anton

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/etcd-io/jetcd/issues/970#issuecomment-953676346, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOIJBMGVS4URTWI637ZEE3UJERFDANCNFSM5DDZ4YJA .

Luca Burgazzoli

1reaction
lburgazzolicommented, Oct 14, 2021

I’m waiting for feedback on another pr, then I can do a release

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 ways to detect and resolve connection errors | Developer Blog
Log in to the EMnify Portal and check the Dashboard. Click on the tab EVENTS. You will see all the network events related...
Read more >
Detecting the connection errors
The connection check method is used to check if there are any errors in the connections. If the timeout for detecting the connection...
Read more >
13 Tips to Troubleshoot Your Internet Connection - PCMag
1. Try Another Device or Website · 2. Check the Wi-Fi Settings · 3. Check Your Internet Package · 4. Scan for Viruses...
Read more >
Detect my SSL connection errors - Site24x7 Support
You can detect your constant SSL connection issues by analyzing your server logs. An SSL connection error normally occurs while establishing a connection...
Read more >
How to Detect and Identify Intermittent Network Problems - Obkio
The most accurate way to detect intermittent network problems is by using a continuous Network Monitoring Software, like ...
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