yii2-queue icon indicating copy to clipboard operation
yii2-queue copied to clipboard

Beanstalkd retrying non retryable job

Open BenasPaulikas opened this issue 1 year ago • 7 comments

class DummyJob extends BaseObject implements RetryableJobInterface
{
    public function execute($queue): void
    {
        sleep(5);
    }

    public function getTtr(): int
    {
        return 1;
    }

    public function canRetry($attempt, $error): bool
    {
        return false;
    }
}

If I push such job to queue I expect it to fail due Ttr and not to be retried. However due how beanstalkd works it just puts job back to queue many times ignoring canRetry()

Any fix. Or should I use different driver?

I use beanstalkd because mysql driver can't handle the load :D


P.S. this is related to

2025-03-15 09:09:11 [-][-][-][error][Pheanstalk\Exception\ServerException] Pheanstalk\Exception\ServerException: Cannot delete job 754021: NOT_FOUND This issue also produces such errors.

BenasPaulikas avatar Mar 15 '25 09:03 BenasPaulikas

yiisoft/yii2-queue 2.3.7 pda/pheanstalk 3.2.1

BenasPaulikas avatar Mar 15 '25 09:03 BenasPaulikas

"Full support of retryable implements for Beanstalk, DB, File, AMQP Interop and Redis drivers."

BenasPaulikas avatar Mar 15 '25 09:03 BenasPaulikas

rel: https://github.com/laravel/framework/issues/3443

BenasPaulikas avatar Mar 15 '25 10:03 BenasPaulikas

Image

BenasPaulikas avatar Mar 15 '25 10:03 BenasPaulikas

Maybe just enough to bury job because Yii2 will handle retrying. ?

BenasPaulikas avatar Mar 15 '25 10:03 BenasPaulikas

Maybe. I don't personally use it. If you know how to fix it, pull request is welcome.

samdark avatar Mar 16 '25 17:03 samdark

TBD. Still happening.

BenasPaulikas avatar Mar 16 '25 18:03 BenasPaulikas