~egtann/srp

a6d5880fe9d1ec727bdd5e8cc315eeec1ce4d7ef — Evan Tann 2 years ago 4303020
fix hanging network conns with cleanhttp
3 files changed, 6 insertions(+), 1 deletions(-)

M go.mod
M go.sum
M proxy.go
M go.mod => go.mod +1 -0
@@ 4,6 4,7 @@ go 1.12

require (
	cloud.google.com/go v0.37.1
	github.com/hashicorp/go-cleanhttp v0.5.1
	github.com/rs/xid v1.2.1
	github.com/rs/zerolog v1.13.0
	golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576

M go.sum => go.sum +2 -0
@@ 40,6 40,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=

M proxy.go => proxy.go +3 -1
@@ 11,6 11,7 @@ import (
	"sync"
	"time"

	"github.com/hashicorp/go-cleanhttp"
	"github.com/rs/xid"
)



@@ 202,7 203,8 @@ func ping(job *healthCheck) error {
		return fmt.Errorf("new request: %s", err)
	}
	req.Header.Add("X-Role", "srp")
	client := &http.Client{Timeout: 10 * time.Second}
	client := cleanhttp.DefaultClient()
	client.Timeout = 10 * time.Second
	resp, err := client.Do(req)
	if err != nil {
		return fmt.Errorf("do: %s", err)