Open antonfirsov opened 3 years ago
Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.
Author: | antonfirsov |
---|---|
Assignees: | - |
Labels: | `area-System.Net.Http`, `untriaged` |
Milestone: | - |
Triage: If we have DNS client (with TTL) - #19443, we won't need this.
edit by Cory: the full strategy we agreed to is in https://github.com/dotnet/runtime/issues/60390#issuecomment-952361723.
Even if we could get TTL info from DNS (and I'm skeptical we will be able to do this any time soon), the ability to "revalidate" a connection is still useful.
With TTL info, we would know when a connection may have become invalid because the DNS info has changed. But just because the TTL has expired doesn't necessarily mean the DNS info has actually changed. Most of the time, it's the same, with an extended TTL.
If we always just drop the connection when the DNS TTL expires, then we still suffer from this problem above:
Connections get discarded regardless of whether they are still valid per current DNS or not.
So I think the ideal solution would be having TTL info + revalidation -- that is, when the TTL expires, we revalidate the DNS info exactly as described above.
In the absence of TTL info, it seems like having the user provide something like PooledConnectionDNSRevalidationPeriod
is a pretty good fallback. Roughly speaking, the user is manually giving us the TTL info instead of automatically retrieving the TTL from DNS.
So I think the ideal solution would be having TTL info + revalidation -- that is, when the TTL expires, we revalidate the DNS info exactly as described above.
In the absence of TTL info, it seems like having the user provide something like
PooledConnectionDNSRevalidationPeriod
is a pretty good fallback. Roughly speaking, the user is manually giving us the TTL info instead of automatically retrieving the TTL from DNS.
The triage comment does not reflect this, but this is the agreement we came to during triage.
DNS is not TCP. DNS TTL is not a reason to close a connection. If a server is not able to handle connection anymore it should close it. If it does not - it a bug of the server, not a client. "PooledConnectionLifetime workaround" is just a step in a wrong direction.
Copying @geoffkizer 's idea from https://github.com/dotnet/dotnet-api-docs/issues/7285#issuecomment-942695230 into a new issue so we can discuss and track it: