Horizon Version
5.45.1
Laravel Version
11.48.0
PHP Version
8.4.18
Redis Driver
PhpRedis
Redis Version
6.0.16
Database Driver & Version
No response
Description
Since #1718, horizon:terminate returns exit code 1 (failure) when no Horizon processes are running. Previously, it returned exit code 0 with an informational message.
This is a breaking change that causes deployment pipelines to fail when Horizon is not currently running.
Problem
In TerminateCommand.php:57-61, the whenEmpty callback sets $exitCode = Command::FAILURE.
"No processes to terminate." is not an error condition — it's a valid state. Having no PID to signal simply means there's nothing to do — the desired state (Horizon not running) is already achieved.
Expected Behavior
horizon:terminate should return exit code 0 when no processes are found, as it did before #1718. The "No processes to terminate." message is fine as informational output, but should not be a failure.
Impact
Any CI/CD pipeline or deployment tool (Deployer) that runs artisan horizon:terminate as part of a deploy sequence now breaks if Horizon isn't running at that moment.
Suggested Fix
Remove Command::FAILURE and use warn or leave info.
Steps To Reproduce
- Have Horizon installed but not running
- Run
php artisan horizon:terminate
- Exit code is 1 with "No processes to terminate."
Horizon Version
5.45.1
Laravel Version
11.48.0
PHP Version
8.4.18
Redis Driver
PhpRedis
Redis Version
6.0.16
Database Driver & Version
No response
Description
Since #1718, horizon:terminate returns exit code 1 (failure) when no Horizon processes are running. Previously, it returned exit code 0 with an informational message.
This is a breaking change that causes deployment pipelines to fail when Horizon is not currently running.
Problem
In TerminateCommand.php:57-61, the whenEmpty callback sets $exitCode = Command::FAILURE.
"No processes to terminate." is not an error condition — it's a valid state. Having no PID to signal simply means there's nothing to do — the desired state (Horizon not running) is already achieved.
Expected Behavior
horizon:terminate should return exit code 0 when no processes are found, as it did before #1718. The "No processes to terminate." message is fine as informational output, but should not be a failure.
Impact
Any CI/CD pipeline or deployment tool (Deployer) that runs artisan horizon:terminate as part of a deploy sequence now breaks if Horizon isn't running at that moment.
Suggested Fix
Remove Command::FAILURE and use warn or leave info.
Steps To Reproduce
php artisan horizon:terminate