ELB is the AWS load balancer. When its load suddenly increases, it can
respond with HTTP 503 errors while it warms up. When it does this over
HTTPS, it also sends a TLS close_notify alert but does not close the
connection itself.
Go's http package receives ELB's 503 responses just fine. However, it
does not read the close_notify alert and so doesn't realize that the
TLS connection is effectively closed. It then tries to reuse the same
connection for its next request. The writes all succeed, but ELB is
completely ignoring everything. Then http attempts to read the
response, the tls.Conn sees the close_notify alert from the previous
response, and the read returns io.EOF.
I think something needs to change in crypto/tls, but I'm not sure of
the best approach. It seems like the writes in the last request should
fail and http should figure out it needs a new connection.
- Evan
As a temporary solution you could try closing the connections after
the 503 response.
http://golang.org/pkg/net/http/#RoundTripper
http://golang.org/pkg/net/http/#Transport
--
André Moraes
http://andredevchannel.blogspot.com/
Done: http://code.google.com/p/go/issues/detail?id=3514
I'm not able to add CCs to issues. Could please do it?
- Evan