Skip to content

Commit

Permalink
cmd/coordinator: extend macOS builder health check coverage
Browse files Browse the repository at this point in the history
Use reverseHostChecker, which handles when a builder restarts between
builds and reconnects quickly—without displaying a fatal error during
that time. Delete the simple hostTypeChecker which does not do that.

This CL tries to implement a temporary fix to make the health check
more useful while the work on adding more builders (and making them
sustainable) is still underway.

For golang/go#49149.

Change-Id: If5fe39b0c7a854a8bcce3095e356d7d2b8faec7e
Reviewed-on: https://go-review.googlesource.com/c/build/+/399041
Run-TryBot: Dmitri Shuralyov <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Auto-Submit: Dmitri Shuralyov <[email protected]>
Reviewed-by: Alex Rakoczy <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
  • Loading branch information
dmitshur authored and gopherbot committed Apr 11, 2022
1 parent 86acb69 commit b82e23d
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions cmd/coordinator/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,21 +371,30 @@ func fetchMakeMacStatus() (errs, warns []string) {
}

func newMacOSARM64Checker() *healthChecker {
var expect int // Number of expected darwin/arm64 reverse builders based on x/build/dashboard.
for hostType, hc := range dashboard.Hosts {
if !strings.HasPrefix(hostType, "host-darwin-arm64-") || !hc.IsReverse {
continue
}
expect += hc.ExpectNum
}
// TODO(go.dev/issue/49149): Compute hosts dynamically after settling on a naming pattern.
// That way it won't be not neccessary to maintain this static map. But this works sooner.
hostsOn20220408 := []string{
"host-darwin-arm64-11_0-toothrot:Gophers-Mini",
"host-darwin-arm64-12_0-toothrot:Gophers-Mini-2",
}
checkReverse := reverseHostChecker(hostsOn20220408)
return &healthChecker{
ID: "macos-arm64",
Title: "macOS ARM64 (M1 Mac minis)",
DocURL: "https://golang.org/issue/39782",
Check: hostTypeChecker("host-darwin-arm64-12_0-toothrot"),
}
}

func hostTypeChecker(hostType string) func(cw *checkWriter) {
want := expectedHosts(hostType)
return func(cw *checkWriter) {
n := pool.ReversePool().SingleHostTypeCount(hostType)
if n < want {
cw.errorf("%d connected; want %d", n, want)
}
Check: func(w *checkWriter) {
checkReverse(w)
if known := len(hostsOn20220408); known < expect {
w.warnf("this check doesn't know about %d more darwin/arm64 reverse builders that are expected", expect-known)
}
},
}
}

Expand Down

0 comments on commit b82e23d

Please sign in to comment.