Closed fungiboletus closed 4 years ago
We're going to turn it off due to the differences. Will make a release in 10 mins.
Once the Travis tests pass, I'll release 11.1.2
.
Released 11.1.2
, please let me know if it's fixed.
It's fixed using the default got options ! 🎉
Thanks a lot for the super quick fix and release.
Describe the bug
The DNS Cache feature may not be well compatible with some Kubernetes clusters.
cacheable-lookup
usesdns.resolve
and notdns.lookup
. As explained in the NodeJS documentation, and in cacheable-lookup's readme,dns.lookup
use the standardgetaddrinfo
from the standard library whiledns.resolve
use a NodeJS implementation.In practices, some DNS phases takes a while. 2s or 5s more in my environment.
Environment
Actual behavior
About 10% of
got
queries are taking up to 2 to 5 seconds during the DNS phase. It's becausegot
usesdns.resolve
and notdns.lookup
. I don't know whydns.resolve
has this issue. If you Google DNS, kubernetes and 5s, you will never consider to use Kubernetes in production again. Anyway,dns.lookup
andgetaddrinfo
are always fast.Expected behavior
All requests should have a fast DNS phase without random delays.
Code to reproduce
First you need a shitty Kubernetes cluster. Azure AKS offers great shitty Kubernetes cluster.
You may see randomly some queries taking 2s or 5s, while most of them are very fast.
If you disable
dnsCache
, all the queries are fast:Suggestion
Perhaps the
dnsCache
option should be false by default, as it introduces major changes in behaviour, as explained in the NodeJS documentation. Another possibility is to add a section in the README about thednsCache
and the considerations to have for some systems such as Kubernetes. Similarly to theretry
option.Checklist