You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Sorry, I don't mean that Canceled status should be split into 3 different statuses. What I mean is that when you click cancel, there are 3 different possible outcomes, which as you note @bpmct, are covered by the existing statuses.
The problem today, is that our code doesn't distinguish all 3 outcomes, and gives the wrong statuses.
If the Job completes successfully before we process the cancel, then today we show status Canceled.
If the Job errors (regardless of whether the error is due to the cancel or not) then today we show Failed.
I feel like our Status computation between Canceled and Failed is wrong
https://github.com/coder/coder/blob/31ffb566d0cedbf1d80f140bc9de36049dc1fe0a/coderd/database/db2sdk/db2sdk.go#L78C1-L85C39
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.
The text was updated successfully, but these errors were encountered: