Repository navigation
Go SDK stop a task at its execution_timeout - #77489
Open
ChickenBenny wants to merge 1 commit into
Open
ChickenBenny wants to merge 1 commit into
ChickenBenny wants to merge 1 commit into
Conversation
ChickenBenny
requested review from
amoghrajesh,
ashb and
jason810496
as code owners
November 23, 2026 10:11
This branch has not been deployed
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.
Follow-up to #76359, the Go part of #74717.
Since #76359 the Go runtime sends
SetExecutionTimeoutbefore the task runs, but it still gives the task no signal at the timeout. The task keeps running until the supervisor sends SIGTERMkilled_task_cleanup_time(60 s by default) later. If the task then returnsnil, it is recorded as success and its retries are skipped.Changes
SetExecutionTimeout, the runtime starts its own clock, so the supervisor's deadline starts no later than the runtime's, as for a Python task.ctxis cancelled with the newsdk.ErrTaskTimeoutas its cause. A task can checkerrors.Is(context.Cause(ctx), sdk.ErrTaskTimeout)to tell a timeout from a shutdown and decide what to clean up.killed_task_cleanup_time, the same as for Python and TypeScript tasks. Then the task fails withtask timed out after N seconds, asRetryTaskwhenshould_retryis set.return_valueXCom, since requests on a cancelledctxfail.ctxis reported as timed out at the SIGTERM. The runtime then exits, which ends the task's goroutine.TriggerDagRuntasks get the same timeout.airflowpackage docs describe the timeout andsdk.ErrTaskTimeout.execution_timeout=10,killed_task_cleanup_time=60ctxnilafterctxis cancelledctxexecution_timeoutNot covered: the remaining timeout after a deferred task resumes (#75317), and the Java part of #74717.
Validation
ctxerror or a value after the timeout fails with it (bothshould_retryvalues) and pushes no XCom; a task that ignores itsctxis reported at the supervisor's SIGTERM; a SIGTERM before the timeout keeps the task's own result; aTriggerDagRuntask times out;secondsToDurationcaps a value past the longesttime.Duration. Without the change, the end-to-end andTriggerDagRuntests hang until their test timeout.go test ./...ingo-sdkpassed;go test -raceonpkg/executionandsdkpassed; prek hooks passed on commit.