Summary
Standalone mode is currently disabled on Windows (PR #2034 excluded it due to Unix syscall usage). The Windows stub in airflow/standalone_windows.go returns errStandaloneWindows for every operation.
However, the low-level process primitives (isProcessAlive, terminateProcess, killProcess) already have Windows implementations in pkg/airflowrt/process_windows.go. The remaining blockers are mechanical — inline syscall.* calls in airflow/standalone.go that need to be abstracted behind platform-specific helpers.
What needs to change
The Unix-specific constructs in standalone.go:
- Process group creation:
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} — on Windows, use Job Objects or CREATE_NEW_PROCESS_GROUP
- Group signal:
syscall.Kill(-pid, syscall.SIGTERM) (4 call sites) — on Windows, use taskkill /T /PID or Job Object termination
- Group force-kill:
syscall.Kill(-pid, syscall.SIGKILL) — on Windows, same as above
- Signal notify:
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM) — os.Interrupt works cross-platform
Approach
- Abstract process group lifecycle behind platform-specific files (
standalone_procgroup_unix.go / standalone_procgroup_windows.go)
- Remove
//go:build !windows from standalone.go
- Replace
standalone_windows.go stub with the real implementation
- Reuse existing
airflowrt cross-platform process helpers where possible
Context
Originally excluded in #2034.
Summary
Standalone mode is currently disabled on Windows (PR #2034 excluded it due to Unix syscall usage). The Windows stub in
airflow/standalone_windows.goreturnserrStandaloneWindowsfor every operation.However, the low-level process primitives (
isProcessAlive,terminateProcess,killProcess) already have Windows implementations inpkg/airflowrt/process_windows.go. The remaining blockers are mechanical — inlinesyscall.*calls inairflow/standalone.gothat need to be abstracted behind platform-specific helpers.What needs to change
The Unix-specific constructs in
standalone.go:cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}— on Windows, use Job Objects orCREATE_NEW_PROCESS_GROUPsyscall.Kill(-pid, syscall.SIGTERM)(4 call sites) — on Windows, usetaskkill /T /PIDor Job Object terminationsyscall.Kill(-pid, syscall.SIGKILL)— on Windows, same as abovesignal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)—os.Interruptworks cross-platformApproach
standalone_procgroup_unix.go/standalone_procgroup_windows.go)//go:build !windowsfromstandalone.gostandalone_windows.gostub with the real implementationairflowrtcross-platform process helpers where possibleContext
Originally excluded in #2034.