cmd/coordinator: delay dashboard pinging until build starts
There were too many blue gophers too early on build.golang.org.
Wait until we have quota first (GCE quota or reverse buildlet pool
aquired).
Updates golang/go#10716
Change-Id: I076e89f319d68d55a61f3f8faf0242342c5ae825
Reviewed-on: https://go-review.googlesource.com/10921
Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/cmd/coordinator/coordinator.go b/cmd/coordinator/coordinator.go
index f99f962..7c8cc68 100644
--- a/cmd/coordinator/coordinator.go
+++ b/cmd/coordinator/coordinator.go
@@ -1100,7 +1100,6 @@
// in either direction.
func (st *buildStatus) start() {
setStatus(st.builderRev, st)
- go st.pingDashboard()
go func() {
err := st.build()
if err != nil {
@@ -2228,6 +2227,7 @@
done time.Time // finished running
succeeded bool // set when done
output bytes.Buffer // stdout and stderr
+ startedPinging bool // started pinging the go dashboard
events []eventAndTime
watcher []*logWatcher
useSnapshotMemo *bool
@@ -2257,6 +2257,13 @@
func (st *buildStatus) logEventTime(event string, optText ...string) {
st.mu.Lock()
defer st.mu.Unlock()
+ switch event {
+ case "creating_gce_instance", "got_machine", "got_buildlet":
+ if !st.startedPinging {
+ st.startedPinging = true
+ go st.pingDashboard()
+ }
+ }
var text string
if len(optText) > 0 {
if len(optText) > 1 {