valyala / fasthttp

Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
MIT License
21.87k stars 1.76k forks source link

DNS Resolve Timeouts are not working #1581

Closed un000 closed 1 year ago

un000 commented 1 year ago

A problem ocurres when DNS doesn't respond properly:

lookup somedomain.com.com on 16.25.25.10:53: server misbehaving

So on the metrics with timeout of 200ms it takes 7-8 seconds

image

https://github.com/valyala/fasthttp/blob/ffdf59d04ca2f02556308d60d37b8e77ea04484c/tcpdialer.go?plain=1#L429-L430

resolveTCPAddrs doesn't use context from the above https://github.com/valyala/fasthttp/blob/ffdf59d04ca2f02556308d60d37b8e77ea04484c/tcpdialer.go?plain=1#L283

I propose to pass it. What you think @erikdubbelboer ?

erikdubbelboer commented 1 year ago

Yes that sounds like a good idea. Can you make a pull request?

un000 commented 1 year ago

Yes that sounds like a good idea. Can you make a pull request?

Done