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.

DNS resolution expiration

See original GitHub issue

It looks like the channel is somehow caching the IP resolved through DNS but never refreshing it. We are using grpc in AWS and since ELB’s IPs change over time, we’ve run into issues and found out grpc clients are trying to connect to an old IP.

Code snippet:

private[this] val channel = NettyChannelBuilder.forAddress(httpHost, httpPort).negotiationType(NegotiationType.PLAINTEXT).build();
  private[this] val blockingStub = CrudGrpc.newBlockingStub(channel)
  private[this] def getStub = blockingStub.withDeadlineAfter(timeout.toNanos, TimeUnit.NANOSECONDS)

override def getEntity(id: String): Entity = {
  getStub.getEntity(id)
}

Is our assumption correct? Is there any issue in how are we using the client library? Would it be a bad practice (performance-wise at least) to create a new channel in each request?

Thanks in advance

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
zhongqlcommented, May 5, 2016

I also encountered such problem, using Python as server, Java as client and appoint NettyChannelBuilder as the ManagedChannel builder, deploy in AWS with ELB, but IP changes over time. if I change ManagedChannel builder to ManagedChannelBuilder, the grpc-java version is 0.13.1, ManagedChannelBuilder using io.grpc.okhttp.OkHttpChannelProvider as provider seems to work fine.

Any suggestion on this?

0reactions
zhangkun83commented, Aug 9, 2018

Yes I think we have addressed the original issue. The periodic refreshing is discussed in #2514

Read more comments on GitHub >

github_iconTop Results From Across the Web

DNS SOA Expire Value - MxToolbox
MxToolBox will issue a warning if your value is less than 2 weeks or more than 4 weeks, which are suggested values.
Read more >
Tips to Make Sure Your DNS Registration Doesn't Expire
One upside to this situation, due to a policy introduced by ICANN a few years ago, is that an expired domain name will...
Read more >
Domain Name Expiry Checker - Check when a domain is ...
Checking the expiration date of a domain name is an easy process, by using the whatsmydns.net domain name expiry checker tool you can...
Read more >
Expiration and deletion of domain registrations - Google Support
From days 31 to 60* after expiration : · Restoration grace period: Your domain name will be prepared for deletion. · From day...
Read more >
What is DNS TTL + Best Practices - Varonis
DNS TTL (time to live) is a setting that tells the DNS resolver how long to cache a query before requesting a new...
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