Bug fix for canceling with after_script for low output scripts
What does this MR do and why?
Bug fix for single line cancellations running after_script
on cancellation
When supporting running the after_script
on cancel we
need to add the Job-Status
to the runner api update
endpoint in addition to the /trace
endpoint.
Previously the Job-Status
was only sent over for the append /trace
endpoint
and the cancellation would cause the update
endpoint to send back a 403
forbidden
http status.
Sending the status for only append /trace
causes single line scripts to never cancel for long commands that don't print to standard out (because we never append the trace).
Having the update endpoint also support Job-Status
allows the cancelation to occur
earlier at the next update request which is specified by the update-Interval
.
Without ci_canceling_status
status enabled, we make it look like the job is canceled on the runner even when it's not yet fully canceled, this is no longer possible with the after_script
logs still to come.
We can consider in another issue, after the release, how to make it even more responsive:
-
We probably don't want to poll more frequently, increasing the load
-
We could consider a webhook, where gitlab sends an http request with the cancellation data to a new runner
PATCH
endpoint.
How to set up and validate locally
See the issue: #456252 (closed)