On Wed, Dec 30, 2015 at 11:13 AM, 'Sebastián Schepens' via golang-nuts
<
golan...@googlegroups.com> wrote:
> The code example i uploaded triggers the behaviour and it does read the body
> and discard it.
> It also doesn't explain why it only happens when requesting the
> LoadBalancer.
The gist you provided will definitely trigger the behavior, because
you haven't changed MaxIdleConnsPerHost.
You say you've tried raising that setting, but not what you set it to,
and this example theoretically needs 10 to be stable, but probably
needs many more than that.
Also, because you're requesting the same host in concurrent tight
loops, you might be triggering a pathological behavior in the
transport where connections can't be recycled fast enough so new
connections are continually created and closed. (There is an open
issue still for a hard upper limit on connections/host:
https://github.com/golang/go/issues/6785)
Try setting MaxIdleConnsPerHost very high and see what happens.