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 <bradfitz@golang.org>
This commit is contained in:
Andrew Gerrand 2016-03-09 09:17:37 +11:00
parent e740c56c6b
commit 498e5ca207
1 changed files with 4 additions and 1 deletions

View File

@ -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()