http client GET with err : dial tcp:look up xxxxx: Temporary failure in name resolution

535 views
Skip to first unread message

Youqi yu

unread,
Aug 26, 2018, 11:47:19 AM8/26/18
to golang-nuts
Hi : 
   as the topic, did anyone met this problem before? I set http client timeout for 2 second, generally It works fine. But sometimes It blocked for more than 4 minutes ,even 14minutes. The goroutines keeps inc as many requests come in. After that block time  all request return this error. I think it's dns lookup block. But I try to make my http client lookup my own DNS server which sleep 1 minute for each dns request, the client always returns in timeout. I can't reproduce the bug. It appears randomly on my online APP.
client:=http.Client{Timeout:2*time.Second}
client
.Get("https://xxxxxx")





Rick Timmis

unread,
Aug 28, 2018, 4:53:50 AM8/28/18
to golang-nuts
Hi, try running your code in a debugger, it smells like a DNS resolution failing, leaving your code awaiting a response.
In a debugger you would be able to see this happening

HTH

Reply all
Reply to author
Forward
0 new messages