Skip to content

[5.x] Fix runaway memory usage with horizon:listen#1716

Merged
taylorotwell merged 1 commit intolaravel:5.xfrom
cosmastech:patch-3
Feb 25, 2026
Merged

[5.x] Fix runaway memory usage with horizon:listen#1716
taylorotwell merged 1 commit intolaravel:5.xfrom
cosmastech:patch-3

Conversation

@cosmastech
Copy link
Contributor

@cosmastech cosmastech commented Feb 24, 2026

To resolve #1715

So it turns out that calling Symfony's Process with an array vs a string produces different behavior. Who knew? It seems that by passing a string, it calls sh <command> rather than exec <command> and the PID belongs to the sh process, not the actual command. Killing that process doesn't kill the underlying supervisor + workers.

Note that the identified problem doesn't appear to be an issue on bare metal on my MBP. However, inside of a docker container, big sadness.

@cosmastech cosmastech marked this pull request as draft February 24, 2026 14:46
@cosmastech cosmastech marked this pull request as ready for review February 25, 2026 02:14
@cosmastech
Copy link
Contributor Author

@saifali-dev would you want to make this change locally and confirm it works for you?

@saifali-dev
Copy link

Thanks @cosmastech. I tested the PR locally (dev-pr-1716) in my app and can confirm it fixes the issue on my end. After multiple horizon:listen restarts, the Horizon master process no longer duplicates.

@taylorotwell taylorotwell merged commit 5d61333 into laravel:5.x Feb 25, 2026
20 checks passed
@cosmastech cosmastech deleted the patch-3 branch February 25, 2026 15:35
lewislarsen pushed a commit to lewislarsen/horizon that referenced this pull request Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

horizon:listen accumulates multiple Horizon master processes on file changes instead of replacing the previous instance

3 participants