dashboard/coordinator: clean up trailer handling
This got lost before in my git stash stack. Change-Id: Id73cdb89e73ab83c26971c6c1c4e0fc74d91018f Reviewed-on: https://go-review.googlesource.com/2521 Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
parent
47646d42a2
commit
d77725735e
|
@ -1013,14 +1013,17 @@ OpLoop:
|
|||
return fmt.Errorf("error copying response: %v", err)
|
||||
}
|
||||
st.logEventTime("done")
|
||||
state := res.Trailer.Get("Process-State")
|
||||
|
||||
// Don't record to the dashboard unless we heard the trailer from
|
||||
// the buildlet, otherwise it was probably some unrelated error
|
||||
// (like the VM being killed, or the buildlet crashing due to
|
||||
// e.g. https://golang.org/issue/9309, since we require a tip
|
||||
// build of the buildlet to get Trailers support)
|
||||
if state != "" {
|
||||
state := res.Trailer.Get("Process-State")
|
||||
if state == "" {
|
||||
return errors.New("missing Process-State trailer from HTTP response; buildlet built with old (<= 1.4) Go?")
|
||||
}
|
||||
|
||||
conf := builders[st.name]
|
||||
var log string
|
||||
if state != "ok" {
|
||||
|
@ -1029,10 +1032,8 @@ OpLoop:
|
|||
if err := conf.recordResult(state == "ok", st.rev, log, time.Since(execStartTime)); err != nil {
|
||||
return fmt.Errorf("Status was %q but failed to report it to the dashboard: %v", state, err)
|
||||
}
|
||||
}
|
||||
if state != "ok" {
|
||||
|
||||
return fmt.Errorf("got Trailer process state %q", state)
|
||||
return fmt.Errorf("%s failed: %v", cmd, state)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue