The Wire · Showcase
HORIZON METRICS BUG SILENTLY LEAKS REDIS KEYS ON PHPREDIS 6.1+
By RepoJournal · Filed · About Laravel
Laravel Horizon's clear-metrics command reports success while accumulating unbounded Redis keys on phpredis 6.1 or newer, potentially starving your queue storage.
Horizon shipped a critical fix [1] for a silent metric-clearing failure that affects any application running phpredis 6.1 or later. The bug stems from a SCAN iterator initialization issue: `horizon:clear-metrics` passes integer `0` to Redis SCAN, but phpredis 6.1+ requires `null` to start iteration, causing the command to report success while leaving queue and job keys untouched [2]. On busy applications, these orphaned `queue:*`, `job:*`, and `snapshot:*` keys accumulate without bound, bloating your Redis instance. The fix has been merged and is live. If you're running Horizon 5.x with phpredis 6.1+, pull the latest code immediately. Meanwhile, GitHub Actions checkout bumped to 7.0.1 [3] with a minor safety improvement for PR workflows.
One email a day. Unsubscribe in one click.
Keep up with Laravel in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Update Laravel Horizon to latest 5.x and run `horizon:clear-metrics` immediately laravel/horizon [immediate]
- → Audit Redis for accumulated queue:*, job:*, and snapshot:* keys if running phpredis 6.1+ laravel/horizon [immediate]
References
- [1] [5.x] Fix `horizon:clear-metrics` clearing nothing on phpredis 6.1+ (#1801) laravel/horizon
- [2] [5.x] Fix `horizon:clear-metrics` clearing nothing on phpredis 6.1+ ↗ laravel/horizon
- [3] chore(deps): bump actions/checkout from 7.0.0 to 7.0.1 in the github-actions group ↗ laravel/moat