ChickenBenny commented on code in PR #77489:
URL: https://github.com/apache/airflow/pull/77489#discussion_r4741030833
##########
go-sdk/pkg/execution/task_runner.go:
##########
@@ -129,6 +130,18 @@ func RunTask(
return failTask(details.TIContext.ShouldRetry, err)
}
+ return timeout.run(ctx, details.TIContext.ShouldRetry, logger, func(ctx
context.Context) any {
Review Comment:
Good catch, moved in 06f13017c2. Now only the task function is timed:
`Execute` resolves the
args, runs `fn.Call` under `ExecutionTimeout.Run`, and then pushes the
return value and skips
downstream tasks outside the timer. `SetExecutionTimeout` is also sent right
before the call, so
the supervisor's clock starts at the same time as ours.
One thing that's different from #76103, though: for branch tasks (`If` /
`Switch`), the decide
and skip steps run outside the timeout here, while TS times them.
- TS: `[fn → decide → skip]` timed, then push `return_value`
- Python: `[fn → decide → skipmixin_key push]` timed, then
`SkipDownstreamTasks` after `execute`
returns (the runtime catches `DownstreamTasksSkipped` outside the timeout)
- Go now: `[fn]` timed, then decide → push `return_value` → skip
I didn't match TS because Go pushes `return_value` *before* skipping, and
the branch tests pin
that order (`TestBranchFunction...` and
`TestServeSkipsDownstreamTasksEndToEnd`). Timing decide
and skip would mean flipping it to skip-then-push, which felt like a
behavior change outside
this PR. Decide and skip are just runtime calls, not user code, so I don't
think leaving them
out of the timer matters much in practice.
That said, I'm fine either way. If you'd rather line it up with TS, I can do
it here, or in a
small follow-up so this PR stays focused. Let me know which you prefer.
`TestExecuteTimesOnlyTheTaskFunction` pins the new order, and
`TestServeDoesNotTimeTheReturnValuePushEndToEnd` fails without this change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]