Andrushika opened a new issue, #74717: URL: https://github.com/apache/airflow/issues/74717
### Under which category would you file this issue? Task SDK ### Apache Airflow version main ### What happened and how to reproduce it? Native Dags in the Go, TypeScript and Java SDKs do not support `execution_timeout` yet. - Go and TypeScript let authors set it. `TaskSpec.ExecutionTimeout` (Go) and the `executionTimeout` task option (TypeScript) are generated from the serialization schema (#73936, #73436), and the value is serialized with the Dag. But the runtimes do not start a timer and do not send `SetExecutionTimeout`, so the supervisor deadline from #73806 is never set either. The task just runs past the timeout. - Java native tasks do not have the field. For comparison, a Python task sends `SetExecutionTimeout` and runs `execute()` under an in-process timeout ([task_runner.py](https://github.com/apache/airflow/blob/2002ba522e69c122ccd06d145e38cc3559cdaae2/task-sdk/src/airflow/sdk/execution_time/task_runner.py#L2264-L2275)). **Steps to reproduce** (Go) 1. Pack a native Go Dag with one task that sleeps 90 seconds, logs every 5 seconds, and has `ExecutionTimeout: 10 * time.Second`. Put it in the Dags folder. 2. Add a Python task with `execution_timeout=timedelta(seconds=10)` that also sleeps 90 seconds, as a control. 3. In `breeze shell --backend postgres`, start the api-server, dag-processor and scheduler with `LocalExecutor`, using the same coordinator config as the Go SDK e2e test. Trigger both Dags. <details><summary>Native Go Dag</summary> ```go func goSleep(actx airflow.Context) error { start := time.Now() for i := 1; i <= 18; i++ { select { case <-actx.Done(): actx.Logger().InfoContext(actx, "context cancelled", "elapsed_s", time.Since(start).Seconds()) return actx.Err() case <-time.After(5 * time.Second): actx.Logger().InfoContext(actx, "still running", "elapsed_s", time.Since(start).Seconds()) } } actx.Logger().InfoContext(actx, "finished after full sleep", "elapsed_s", time.Since(start).Seconds()) return nil } func main() { bundle := airflow.Bundle() dag := airflow.Dag("timeout_repro_native", airflow.DagSpec{Queue: "golang"}) dag.Task(goSleep, airflow.TaskSpec{TaskID: "go_sleep", ExecutionTimeout: 10 * time.Second}) bundle.Register(dag) if err := bundle.Serve(); err != nil { log.Fatal(err) } } ``` </details> **Result** | task | serialized `execution_timeout` | final state | ran for | |---|---|---|---| | Python control | 10.0 | failed, `AirflowTaskTimeout` | about 13s | | native Go `go_sleep` | 10.0 | success | about 90s | The Go task log has a `still running` line every 5 seconds up to `elapsed_s=90.15`, then `finished after full sleep`. It has no cancel or SIGTERM line. I only ran Go. The TypeScript and Java parts come from reading the code. ### What you think should happen instead? The task should fail when it runs past `execution_timeout`, like a Python task, with its retries applied. ### Operating System macOS 15 host, Breeze CI image (Python 3.11, Postgres 14) ### Deployment None ### Apache Airflow Provider(s) _No response_ ### Versions of Apache Airflow Providers _No response_ ### Official Helm Chart version Not Applicable ### Kubernetes Version _No response_ ### Helm Chart configuration _No response_ ### Docker Image customizations _No response_ ### Anything else? If I read the code right, this looks like an SDK-only change in all three. The runtime already has the task spec, and `SetExecutionTimeout` is already in the generated supervisor models. Java would also need the field in its authoring API. For Go and TypeScript, the fields are not in the released go-sdk `v1.0.0-beta3` or ts-sdk `0.1.0-beta1` yet. The genspec exclude list says that a field the SDK cannot honour yet is worse than a missing field ([authoring.go](https://github.com/apache/airflow/blob/2002ba522e69c122ccd06d145e38cc3559cdaae2/go-sdk/internal/genspec/authoring.go#L165-L167)). So if this cannot land before the release, excluding the field until it works might be an option. related: #74716 ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md) -- 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]
