laravel / horizon

Dashboard and code-driven configuration for Laravel queues.
https://laravel.com/docs/horizon
MIT License
3.87k stars 657 forks source link

Retrying failed jobs from Batches does not reset `cancelled` status #1042

Closed ThaDaVos closed 3 years ago

ThaDaVos commented 3 years ago

Description:

When retrying all failed jobs from the batch screen one would expect the batch to be uncancelled and if one is following the documentation to define a batchable job, the failed jobs would run: https://laravel.com/docs/8.x/queues#defining-batchable-jobs

BUT, as the batch isn't uncancelled and one started their handle method according to the documentation (see below code), yes they will succeed immediatly but not how one would expect as no part of the job has run...

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        if ($this->batch()->cancelled()) {
            // Determine if the batch has been cancelled...

            return;
        }

        // Rest of job code
    }

Steps To Reproduce:

Information given above see Description

driesvints commented 3 years ago

Heya, thanks for reporting.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as separate commits on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Please do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

driesvints commented 3 years ago

Closing this issue because it's inactive, already solved, old or not relevant anymore. Feel to open up a new issue if you're still experiencing this.

ThaDaVos commented 3 years ago

Seriously... it's not even a week old... please give people sometime to do the stuff you asked or even respond... I've had a few really busy days since then...

driesvints commented 3 years ago

Feel free to open a new issue when you're ready 👍

ThaDaVos commented 3 years ago

Why would I open a new issue if it gets closed if I don't respond quick enough... don't see the point of reporting this anymore... 😒

Also I thought my description was clear enough as it was all according the docs...

itabirca commented 5 months ago

Steps to reproduce:

This is so misleading.