Summary
conductor worker remote --type <task> with a PYTHON worker uses a single --timeout flag as two different timeouts, in two different units. The same integer becomes a millisecond poll timeout and a second-denominated worker execution timeout.
Details
In executePythonWorkerFromFile (cmd/worker.go), the flag is read once:
execTimeout, _ := cmd.Flags().GetInt32("timeout") // cmd/worker.go:1136 — default 100
Used as the server-side long-poll timeout, in milliseconds:
if execTimeout > 0 {
opts.Timeout = optional.NewInt32(execTimeout) // cmd/worker.go:1170
}
Then passed as the worker execution timeout, which is interpreted in seconds:
executeExternalWorker(t, pythonCmd, []string{workerFile}, workerId, domain, execTimeout, false, taskClient) // :1190
// executeExternalWorker, cmd/worker.go:551
if execTimeout > 0 {
ctx, cancel = context.WithTimeout(ctx, time.Duration(execTimeout)*time.Second)
}
So the default --timeout 100 means a 100 ms poll timeout and a 100 s exec timeout. Raising the poll timeout silently raises the exec timeout by a factor of 1000, and there is no way to set one without changing the other.
The variable is also named execTimeout while being used as the poll timeout, which is likely how this crept in.
Scope
- Affects
worker remote with language: PYTHON only.
executeJsWorkerFromFile reads the same flag but uses it for polling only (cmd/worker.go:1002, :1025) — correct, though it inherits the naming confusion.
worker stdio correctly separates --poll-timeout (ms) and --exec-timeout (s).
Suggested fix
Split the flags on worker remote to match worker stdio: --poll-timeout (ms) and --exec-timeout (s), and rename the local variable to match its use. Aligning the flag names across all worker subcommands is tracked separately in the convergence issue.
Summary
conductor worker remote --type <task>with a PYTHON worker uses a single--timeoutflag as two different timeouts, in two different units. The same integer becomes a millisecond poll timeout and a second-denominated worker execution timeout.Details
In
executePythonWorkerFromFile(cmd/worker.go), the flag is read once:Used as the server-side long-poll timeout, in milliseconds:
Then passed as the worker execution timeout, which is interpreted in seconds:
So the default
--timeout 100means a 100 ms poll timeout and a 100 s exec timeout. Raising the poll timeout silently raises the exec timeout by a factor of 1000, and there is no way to set one without changing the other.The variable is also named
execTimeoutwhile being used as the poll timeout, which is likely how this crept in.Scope
worker remotewithlanguage: PYTHONonly.executeJsWorkerFromFilereads the same flag but uses it for polling only (cmd/worker.go:1002,:1025) — correct, though it inherits the naming confusion.worker stdiocorrectly separates--poll-timeout(ms) and--exec-timeout(s).Suggested fix
Split the flags on
worker remoteto matchworker stdio:--poll-timeout(ms) and--exec-timeout(s), and rename the local variable to match its use. Aligning the flag names across allworkersubcommands is tracked separately in the convergence issue.