Fix stopping Terraform tasks in waiting_confirmation stage#3694
Open
JulianKap wants to merge 1 commit intosemaphoreui:developfrom
Open
Fix stopping Terraform tasks in waiting_confirmation stage#3694JulianKap wants to merge 1 commit intosemaphoreui:developfrom
JulianKap wants to merge 1 commit intosemaphoreui:developfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Title
Fix task stopping behavior for terraform tasks in
waiting_confirmationstateDescription
This PR fixes incorrect task status handling when attempting to stop tasks that are in the
waiting_confirmationstate.Additionally, a bug was fixed where tasks would fail to stop at the
waiting_confirmationstage (except in force stop mode).Observed problem
When trying to stop a task that is waiting for confirmation (for example during Terraform workflows), the task could not be stopped normally.
UI behavior
When clicking Stop for a task in
waiting_confirmation:stopping.waiting_confirmationand the original confirmation buttons reappeared.As a result, the normal stop operation did not work.
The only reliable way to stop the task was - quickly pressing Force Stop in the UI before the status reverted.
Root cause (Issue 1)
The runner periodically sends task statuses to the server.
When a user attempted to stop a task:
stopping.waiting_confirmation.stoppingstate on the server.As a result, the task reverted back to
waiting_confirmation, making normal stopping impossible.Root cause (Issue 2 – Terraform specific)
At the
waiting_confirmationstage, when a task transitioned to the stopping status, the infinite loop of waiting for confirmation or aborting the task execution was not exited.As a result, the task at the
stoppingstage could not transition to thestoppedstatus.Solution
This PR fixes both issues:
stoppingstate withwaiting_confirmation.Result
waiting_confirmationcan now be stopped normallystoppingstate is no longer overwritten by runner status updates