Description
I feel like our Status computation between Canceled and Failed is wrong
We only return Canceled if there is no Error, but the terraform provisioner generally returns an Error when it is canceled, so the Status ends up Canceling -> Failed.
I don't think its a good idea for provisioners to not return an Error when canceled, because then we can't tell the difference between something that was genuinely canceled and a job that completed before the cancel was processed.
So, in practice, we never see the Canceled state.
I did some digging, and it was me that complained about not being able to get to the "failed" state after cancel in the first place: #1374
Perhaps we need to distinguish 3 cases in the response from the provisioner after you send the cancel.
- Job completed successfully before we processed the cancel
- Job canceled
- Job failed for a reason unrelated to the cancel