cancelTime property

  1. @TagNumber(32)
Timestamp cancelTime

When the cancel process of the build started. Note it's not the time that the cancellation completed, which would be tracked by end_time.

During the cancel process, the build still accepts updates.

bbagent checks this field at the frequency of buildbucket.MinUpdateBuildInterval. When bbagent sees the build is in cancel process, there are two states:

  • it has NOT yet started the exe payload,
  • it HAS started the exe payload.

In the first state, bbagent will immediately terminate the build without invoking the exe payload at all.

In the second state, bbagent will send SIGTERM/CTRL-BREAK to the exe (according to the deadline protocol described in https://chromium.googlesource.com/infra/luci/luci-py/+/HEAD/client/LUCI_CONTEXT.md). After grace_period it will then try to kill the exe.

NOTE: There is a race condition here; If bbagent starts the luciexe and then immediately notices that the build is canceled, it's possible that bbagent can send SIGTERM/CTRL-BREAK to the exe before that exe sets up interrupt handlers. There is a bug on file (crbug.com/1311821) which we plan to implement at some point as a mitigation for this.

Additionally, the Buildbucket service itself will launch an asynchronous task to terminate the build via the backend API (e.g. Swarming cancellation) if bbagent cannot successfully terminate the exe in time.

Implementation

@$pb.TagNumber(32)
$1.Timestamp get cancelTime => $_getN(27);
  1. @TagNumber(32)
void cancelTime=(Timestamp v)

Implementation

@$pb.TagNumber(32)
set cancelTime($1.Timestamp v) {
  setField(32, v);
}