-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting a serializer in redis options causes queue to re-run completed jobs #47578
Comments
I have the same issue with this configuration Laravel Version 10.13.5 PHP 8.2.5 Redis 6.0.16 When I dispatch the job to a queue it runs and complete with success. This is my configuration 'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
'password' => env('REDIS_PASSWORD', null),
//'serializer' => env('REDIS_SERIALIZER', 2),//2=Redis::SERIALIZER_IGBINARY
'compression' => env('REDIS_COMPRESSION', 3),//3=Redis::COMPRESSION_LZ4,
], If i set 'compression'=>null everything goes as expected. |
This is expected. You need to make sure your queues are empty before changing these options. |
Sorry @driesvints, but what do you mean by "This is expected"? Is it expected for queue with redis driver do not work if it has anything else set on "serializer" or "compression" option? I'm facing same issue. Queues do not work if you use serializer or compression. How to reproduce:
|
I have the same weird problem like @tarkis. |
I'm sorry but I fail to understand how it can re-run completed jobs if the database is empty? Are you 100% sure it's entirely cleared? |
Thank you for reporting this issue! As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub. If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team. Thank you! |
Since it seems we added a warning about this in the docs, I'm closing this one. |
Laravel Version
10.13.5
PHP Version
8.2.7
Database Driver & Version
Server: Redis 7.0.9 container on aarch64 k3s instance phpredis: 5.3.7
Description
When using redis via phpredis as a queue database, setting the serializers option in database.php causes complete jobs to be retried even after completing successfully after the retry_value has been met. Eventually the job will be marked as failed based on whatever value is being used. This occurs regardless of if you use queue:work or horizon for managing the queue.
Before I worked out the root cause of my jobs repeating, I ruled out anything in the job class itself or how it's dispatched as making a difference. Even a completely empty job that had just been created using artisan would exhibit this behaviour.
This also seems to occur regardless of what the serializer option is actually set to, just having it set causes the jobs to be retried.
Although my development environment is an apple silicon mac running PHP 8.2 installed from brew, I was able to recreate this on both an aarch64 and x86_64 linux environment as well (connecting to the same redis server instance).
Steps To Reproduce
The text was updated successfully, but these errors were encountered: