Skip to content

Commit

Permalink
cmd/tip: clear error when process starts successfully
Browse files Browse the repository at this point in the history
We want the error to represent an ongoing problem. It's less useful
to constantly show the last error; we have logs for that.

This will help make the _tipstatus output more readable for humans,
and more friendly to being monitored by farmer.golang.org#health.

Updates golang/go#15266
Fixes golang/go#32949

Change-Id: I20e5f180209c54b31e81e29bd45af0e2d205d3cc
Reviewed-on: https://go-review.googlesource.com/c/build/+/185139
Run-TryBot: Dmitri Shuralyov <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Emmanuel Odeke <[email protected]>
  • Loading branch information
dmitshur committed Jul 9, 2019
1 parent 7e427ad commit 30c0e6b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/tip/tip.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,18 @@ func main() {
}

// Proxy implements the tip.golang.org server: a reverse-proxy
// that builds and runs golangorg instances showing the latest docs.
// that builds and runs golangorg instances showing the latest
// Go website and standard library documentation.
type Proxy struct {
builder Builder

mu sync.Mutex // protects following fields
proxy http.Handler
cur string // signature of gorepo+toolsrepo
cur string // signature of gorepo+websiterepo
cmd *exec.Cmd // live golangorg instance, or nil for none
side string
hostport string // host and port of the live instance
err error
err error // non-nil when there's a problem
}

type Builder interface {
Expand Down Expand Up @@ -254,6 +255,7 @@ func (p *Proxy) poll() {
p.cmd.Process.Kill()
}
p.cmd = cmd
p.err = nil // If we get this far, the process started successfully. Clear the error.
}

type serveOptions struct {
Expand Down

0 comments on commit 30c0e6b

Please sign in to comment.