From 498e5ca20752b991e09551fa8fdebca879eaeedb Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Wed, 9 Mar 2016 09:17:37 +1100 Subject: [PATCH] cmd/tip: kill godoc when it fails to be ready on time If godoc didn't come up quickly enough, we would leave it running and then try to start another one on the same port. The new one would fail to start, being unable to bind to the address, causing cascading failures. Also increase the timeout to 10 minutes. Change-Id: I7008a39f649021ea213902d557f26bf78567026d Reviewed-on: https://go-review.googlesource.com/20420 Reviewed-by: Brad Fitzpatrick --- cmd/tip/tip.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/tip/tip.go b/cmd/tip/tip.go index 099b75e9..2e537d0a 100644 --- a/cmd/tip/tip.go +++ b/cmd/tip/tip.go @@ -27,7 +27,7 @@ import ( const ( repoURL = "https://go.googlesource.com/" metaURL = "https://go.googlesource.com/?b=master&format=JSON" - startTimeout = 5 * time.Minute + startTimeout = 10 * time.Minute ) func main() { @@ -179,6 +179,9 @@ func (p *Proxy) poll() { } }() err = waitReady(p.builder, hostport) + if err != nil { + cmd.Process.Kill() + } } p.mu.Lock()