laravel/framework — pull request #5707 by mohitmamoria (2014-09-11 06:51:17+00:00)
Title: Fixed the bug of replication of redis queue jobs

The bug arose in a very special case - when there are more than one worker processing the jobs off the Redis queue.

When a job fails, it is passed into `:delayed` sorted set where worker gets to pick it up in next call of `pop()` method. The `pop()` method gets the jobs from `:delayed` sorted set in one query and then remove them in another query. As this process of **fetching and removing** is not atomic, many workers can fetch the job simultaneously before anyone removes it from the sorted set, thus creating a copy of job with each worker.

The solution to this bug is to process the **fetching and removing** in a transaction, which this pull request does.