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/types/types.go b/types/types.go
index 081f049..a068ae6 100644
--- a/types/types.go
+++ b/types/types.go
@@ -173,7 +173,12 @@
// clients or show on trybot status pages to tell the user who long
// they're expected to wait.
type BuildletWaitStatus struct {
- Ahead int `json:"ahead"` // number of waiters ahead of this buildlet request
+ // Message is a free-form message to send to the user's gomote binary.
+ // If present, all other fields are ignored.
+ Message string `json:"message"`
+
+ // Ahead are the number of waiters ahead of this buildlet request.
+ Ahead int `json:"ahead"`
// TODO: add number of active builds, and number of builds
// creating. And for how long. And maybe an estimate of how