Skip to content

[5.1] [5.2] Multiple queue workers using Redis #8577

@m4tthumphrey

Description

@m4tthumphrey

Possible cause/result of #8576.

It seems that using several workers (php artisan queue:work --daemon ...) via supervisor cause the jobs to be picked up by multiple workers at the same time, causing all kinds of havoc.

I have 10 workers in my case, that download a file from an FTP server, save the file itself locally, inserts a row in a database and then delete the original file from the FTP site.

I've experienced several times now, that several rows appear in the database, and sometimes I get an error informing me that the file on the FTP site doesn't exist but the row appears in the database meaning that it has already been processed. I am also pummelled with the redis errors found in #8576 (Predis\Transaction\AbortedMultiExecException)

I should say that this doesn't happen all the time, only for some jobs...

FYI, I've temporarily reduced the number of workers to 1 and I haven't had a user error since, altho I do still get the Predis errors.

I've tried to reproduce this locally but cannot, it seems that it works as expected. I don't get the Predis error either. The only difference is that I'm using supervisor in production and 10 terminals on my Mac...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions