# Fix: Enforce timeoutSec on Windows and prevent process hangs
## Problem Description
When `timeoutSec` is set on a DAG step, processes that exceed the
timeout should be forcibly terminated. However, on Windows, some
processes would continue running for hours even when `timeoutSec` was
set (e.g., to 900 seconds).
### Root Cause
The issue had two components:
1. **Blocking `cmd.Wait()`**: The `commandExecutor.Run()` method blocked
indefinitely on `cmd.Wait()` without listening to context cancellation.
When the timeout expired, the process would not be killed because the
code was stuck waiting for `Wait()` to return.
2. **Incomplete process termination on Windows**: The Windows
`KillProcessGroup()` function only killed the immediate process, leaving
child processes (subprocess tree) orphaned and running.
## Changes Made
### 1. `internal/runtime/builtin/command/command.go`
Modified the `Run()` method to:
- Run `cmd.Wait()` in a goroutine with a result channel
- Use `select` to watch for both context cancellation and command
completion
- Forcibly kill the process when context is cancelled (timeout)
- Return exit code 124 (standard timeout exit code) on timeout
### 2. `internal/cmn/cmdutil/cmd_windows.go`
Updated `KillProcessGroup()` to:
- Use `killProcessTree()` instead of just `cmd.Process.Kill()`
- Ensure child processes are also terminated on Windows
- Match the behavior used in `KillMultipleProcessGroups()` and Unix
implementation
## Impact
- **timeoutSec** now works reliably on all platforms, especially Windows
- Processes that hang due to I/O blocking or zombie states are properly
terminated
- Child processes on Windows are no longer orphaned when the parent is
killed
- Exit code 124 is returned for timeout scenarios (consistent with Unix
timeout behavior)
## Files Changed
1. `internal/runtime/builtin/command/command.go` - Core timeout
enforcement fix
2. `internal/cmn/cmdutil/cmd_windows.go` - Windows process tree
termination fix
* **New Features**
* Added distributed DAG execution support with coordinator integration
for remote execution on worker nodes.
* Introduced live remote progress display with spinner animation for
distributed DAG runs.
* Added DAG run cancellation support for distributed executions.
* Enabled real-time scheduler log streaming to coordinator.
* Implemented graceful shutdown handling via SIGINT/SIGTERM signals.
* **Improvements**
* Automatic worker ID derivation from hostname when not explicitly
configured.
* Enhanced log file error handling with proper 404 detection in UI.
* **New Features**
- SSH now supports optional shell configuration for remote command
execution; shell can be specified at DAG or step level with proper
precedence handling.
- Added controls for variable expansion behavior in command evaluation.
* **Bug Fixes**
- Improved Docker container timeout error reporting with clearer status
information.
* **Tests**
- Expanded shell detection and command building test coverage.
- Added comprehensive shell configuration precedence tests for SSH.
Resolves#1512
* **Bug Fixes**
* Improved handling of SMTP and Mail configuration so empty/partial
configs are detected and applied consistently.
* **Tests**
* Added tests covering configuration override and inheritance scenarios
for SMTP and mail settings.
* **Chores**
* Added internal compile-time assertions to reinforce interface
conformance and code correctness.
* **New Features**
* Steps can contain multiple commands executed sequentially; UIs and
runners display and run command lists.
* **Validation**
* Executors advertise capabilities and produce clearer errors when
features conflict or are unsupported (multi-command vs
sub-workflow/script/container).
* **API**
* Step payloads now use a commands list for command entries; legacy
single-command fields remain supported for compatibility.
* **Integration & UX**
* Schemas, APIs, reporting, and UI components updated to present and
handle the commands array.