Skip to content

Enable standalone mode on Windows #2177

Description

@odaneau-astro

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:

  1. Process group creation: cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} — on Windows, use Job Objects or CREATE_NEW_PROCESS_GROUP
  2. Group signal: syscall.Kill(-pid, syscall.SIGTERM) (4 call sites) — on Windows, use taskkill /T /PID or Job Object termination
  3. Group force-kill: syscall.Kill(-pid, syscall.SIGKILL) — on Windows, same as above
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions