enqueue-dev icon indicating copy to clipboard operation
enqueue-dev copied to clipboard

predis client errors in cluster context

Open bradfordcondon opened this issue 2 months ago • 0 comments

The error

PHP Fatal error:  Uncaught Predis\Response\ServerException: CROSSSLOT Keys in request don't hash to the same slot in predis/predis/src/Client.php:370

We are encountering this with the predis client.

The cause and possible solution

We believe the issue is specifically that migrateExpiredMessages isn't compatible with redis cluster mode. It looks up queue-name:reserved instead of {queue-name}:reserved. We were able to do a hacky workaround by naming all of our queues in {} thus forcing a specific node in the cluster.

https://github.com/php-enqueue/redis/blob/master/RedisConsumerHelperTrait.php#L102

It seems like the configuration options of the enqueue wrapper could more easily support the predis cluster config options.

see also:

#1224

bradfordcondon avatar Oct 28 '25 18:10 bradfordcondon