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,26 +1013,27 @@ OpLoop:
|
||||||
return fmt.Errorf("error copying response: %v", err)
|
return fmt.Errorf("error copying response: %v", err)
|
||||||
}
|
}
|
||||||
st.logEventTime("done")
|
st.logEventTime("done")
|
||||||
state := res.Trailer.Get("Process-State")
|
|
||||||
|
|
||||||
// Don't record to the dashboard unless we heard the trailer from
|
// Don't record to the dashboard unless we heard the trailer from
|
||||||
// the buildlet, otherwise it was probably some unrelated error
|
// the buildlet, otherwise it was probably some unrelated error
|
||||||
// (like the VM being killed, or the buildlet crashing due to
|
// (like the VM being killed, or the buildlet crashing due to
|
||||||
// e.g. https://golang.org/issue/9309, since we require a tip
|
// e.g. https://golang.org/issue/9309, since we require a tip
|
||||||
// build of the buildlet to get Trailers support)
|
// build of the buildlet to get Trailers support)
|
||||||
if state != "" {
|
state := res.Trailer.Get("Process-State")
|
||||||
conf := builders[st.name]
|
if state == "" {
|
||||||
var log string
|
return errors.New("missing Process-State trailer from HTTP response; buildlet built with old (<= 1.4) Go?")
|
||||||
if state != "ok" {
|
}
|
||||||
log = st.logs()
|
|
||||||
}
|
conf := builders[st.name]
|
||||||
if err := conf.recordResult(state == "ok", st.rev, log, time.Since(execStartTime)); err != nil {
|
var log string
|
||||||
return fmt.Errorf("Status was %q but failed to report it to the dashboard: %v", state, err)
|
if state != "ok" {
|
||||||
}
|
log = st.logs()
|
||||||
|
}
|
||||||
|
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" {
|
if state != "ok" {
|
||||||
|
return fmt.Errorf("%s failed: %v", cmd, state)
|
||||||
return fmt.Errorf("got Trailer process state %q", state)
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue