cmd/coordinator: make contended gomote create request cancel post-submit build
If somebody wants to "gomote create" a reverse buildlet that's busy
doing a post-submit build, the coordinator tries to find an active
non-trybot build and call (*buildStatus).cancelBuild() on it, to make
it clean up and return itself to the coordinator, so the scheduler
will get it soon and give it to the gomote user.
Fixes golang/go#35714
Change-Id: I417aead083cf3520058b3fd4d626fc385f25984e
Reviewed-on: https://go-review.googlesource.com/c/build/+/209757
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
diff --git a/cmd/gomote/create.go b/cmd/gomote/create.go
index 5bf0ac6..18d0d2c 100644
--- a/cmd/gomote/create.go
+++ b/cmd/gomote/create.go
@@ -115,6 +115,10 @@
}
client, err := cc.CreateBuildletWithStatus(builderType, func(st types.BuildletWaitStatus) {
if status {
+ if st.Message != "" {
+ fmt.Fprintf(os.Stderr, "# %s\n", st.Message)
+ return
+ }
fmt.Fprintf(os.Stderr, "# still creating %s after %v; %d requests ahead of you\n", builderType, time.Since(t).Round(time.Second), st.Ahead)
}
})