Re: [go-nuts] Trying to understand HTTP connection pooling behaviour - new DNS lookup

2020-11-28 Thread Amit Saha
> On 28 Nov 2020, at 11:22 pm, b.ca...@pobox.com wrote: > > > My actual query was to learn how the removal of the broken connection is > > done. > > Ah OK. I'm not familiar with this code (net/http/transport.go), and you've > already shown that the PutIdleConn trace action isn't called. Ma

Re: [go-nuts] Trying to understand HTTP connection pooling behaviour - new DNS lookup

2020-11-28 Thread b.ca...@pobox.com
> My actual query was to learn how the removal of the broken connection is done. Ah OK. I'm not familiar with this code (net/http/transport.go), and you've already shown that the PutIdleConn trace action isn't called. Maybe this comment is helpful: if pconn.isBroken()

Re: [go-nuts] Trying to understand HTTP connection pooling behaviour - new DNS lookup

2020-11-28 Thread Amit Saha
> On 28 Nov 2020, at 10:36 pm, b.ca...@pobox.com wrote: > > Unless you timestamp those log lines, I don't see any evidence that the DNS > query is done when the godoc server shuts down. Could it not just be that > after the 2 second sleep, when it's time to make a new connection, it finds >

Re: [go-nuts] Trying to understand HTTP connection pooling behaviour - new DNS lookup

2020-11-28 Thread b.ca...@pobox.com
Unless you timestamp those log lines, I don't see any evidence that the DNS query is done when the godoc server shuts down. Could it not just be that after the 2 second sleep, when it's time to make a new connection, it finds that the pool is empty so has to do a lookup to establish a new conne

Re: [go-nuts] Trying to understand HTTP connection pooling behaviour - new DNS lookup

2020-11-28 Thread Amit Saha
> On 28 Nov 2020, at 8:14 pm, b.ca...@pobox.com wrote: > > Do you see a forward or reverse DNS lookup being made? > > Can you provide a standalone program which demonstrates this behaviour? > > I am wondering if either (a) something is logging when the connection is > terminated, or (b) a n

[go-nuts] Trying to understand HTTP connection pooling behaviour - new DNS lookup

2020-11-27 Thread Amit Saha
Hi, it seems that the http client automatically performs a DNS lookup when an existing connection is terminated by the server. I simulated it via changing the IP address in /etc/hosts. Can someone point me to the code where this logic is checked? I am looking at https://golang.org/src/net/http/