Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

DNS does not update #91

Open
bladefist opened this issue Jun 8, 2020 · 5 comments
Open

DNS does not update #91

bladefist opened this issue Jun 8, 2020 · 5 comments
Assignees

Comments

@bladefist
Copy link

Pretty simple report, if you use collector.example.com and you change that dns to point to another IP, the collector will not update until you cycle the app.

@russorat
Copy link
Contributor

@bladefist thanks for the issue. In other client libs you've used, is this option configurable or always on?

@bladefist
Copy link
Author

I'm not sure as I would never cheat on this repository. I will say this is an issue that has come up before when using HttpClient (I assume this repo uses it). There are some easy fixes. If you're using a singleton it can be re-instated periodically. There are other solutions but I will admit I'm not an expert on it. thanks!

@bednar
Copy link
Contributor

bednar commented Jul 3, 2020

Hi @bladefist,

I've been investigate how to fix it and it is a little bit complicated than it looks like. As you assume we are using a singleton:

_httpClient = new HttpClient(handler) { BaseAddress = serverBaseAddress };
so re-instated periodically is possible but it seems to me a too tricky 😄.

The next option is use a ServicePoint.ConnectionLeaseTimeout but it looks that it isn't supported on all platforms.

Regards

@sgtfrankieboy
Copy link

Starting from .NET Core 2.1 its possible to use IHttpClientFactory to handle the creation and recycling of the HttpClient/HttpMessageHandler, solving the DNS issue. An issue is that its coupled with Microsoft.Extensions.DependencyInjection.

@wbaldoumas
Copy link

Any updates on this issue? We ran into this exact problem on my team yesterday and it bit us pretty hard. We're using v1.1.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants