-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix Timeout-minutes for Whole Composite Action Step #599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -273,30 +279,7 @@ private async Task RunStepAsync(IStep step) | |||
step.ExecutionContext.Result = Common.Util.TaskResultUtil.MergeTaskResults(step.ExecutionContext.Result, step.ExecutionContext.CommandResult.Value); | |||
} | |||
|
|||
// Fixup the step result if ContinueOnError. | |||
if (step.ExecutionContext.Result == TaskResult.Failed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this since we'll explicitly disallow Continue on error for each composite step for now.
@@ -60,10 +60,12 @@ public interface IExecutionContext : IRunnerService | |||
|
|||
bool EchoOnActionCommand { get; set; } | |||
|
|||
IExecutionContext JobExecutionContext { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we expose Root { get; }
instead?
@@ -254,7 +258,7 @@ public void RegisterPostJobStep(IStep step) | |||
DictionaryContextData inputsData, | |||
Dictionary<string, string> envData) | |||
{ | |||
step.ExecutionContext = Root.CreateChild(_record.Id, step.DisplayName, _record.Id.ToString("N"), scopeName, step.Action.ContextName, logger: _logger); | |||
step.ExecutionContext = Root.CreateChild(_record.Id, step.DisplayName, _record.Id.ToString("N"), scopeName, step.Action.ContextName, logger: _logger, cancellationTokenSource: _cancellationTokenSource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make more sense for the interface to pass CancellationToken.CreateLinkedTokenSource(_cancellationTokenSource)
* Exploring child Linked Cancellation Tokens * Preliminary Timeout-minutes fix * Final Solution for resolving cancellation token's timeout vs. cancellation * Clean up + Fix error handling * Use linked tokens instead * Clean up * one liner * Remove JobExecutionContext => Replace with public Root accessor * Move CreateLinkedTokenSource in the CreateCompositeStep Function
* Exploring child Linked Cancellation Tokens * Preliminary Timeout-minutes fix * Final Solution for resolving cancellation token's timeout vs. cancellation * Clean up + Fix error handling * Use linked tokens instead * Clean up * one liner * Remove JobExecutionContext => Replace with public Root accessor * Move CreateLinkedTokenSource in the CreateCompositeStep Function
* Exploring child Linked Cancellation Tokens * Preliminary Timeout-minutes fix * Final Solution for resolving cancellation token's timeout vs. cancellation * Clean up + Fix error handling * Use linked tokens instead * Clean up * one liner * Remove JobExecutionContext => Replace with public Root accessor * Move CreateLinkedTokenSource in the CreateCompositeStep Function
* Exploring child Linked Cancellation Tokens * Preliminary Timeout-minutes fix * Final Solution for resolving cancellation token's timeout vs. cancellation * Clean up + Fix error handling * Use linked tokens instead * Clean up * one liner * Remove JobExecutionContext => Replace with public Root accessor * Move CreateLinkedTokenSource in the CreateCompositeStep Function
The timeout-minutes token set in the workflow file for an individual composite action is correctly processed with the CancellationToken for the ExecutionContext of the whole composite action step but for some reason my composite action cannot differentiate between cancellation and timing out
In this PR, we fix that. We also remove unnecessary code as well.
Example Cancel: https://github.com/ethanchewy/testing-actions/runs/891636687
Example of 1 min. Timeout: https://github.com/ethanchewy/testing-actions/runs/891641094?check_suite_focus=true