udokmeci/yii2-beanstalk

Exception: 'Job 5 NOT_FOUND: does not exist or is not reserved by client'

Closed this issue · 3 comments

Hi.
I have issue:
exception 'Pheanstalk\Exception\ServerException' with message 'Job 5 NOT_FOUND: does not exist or is not reserved by client' in /var/www/site/vendor/pda/pheanstalk/src/Command/ReleaseCommand.php:63

My code executes about 77 s. I think, that is why I have this issue.
What can I do for fix this?
Help please.
Thks.

Hey, if you have data and done with it just return no-action so it will not try to release a gone job or just catch the error and do nothing

19 Haz 2015 tarihinde 01:10 saatinde, vitaliykoziy notifications@github.com şunları yazdı:

Hi.
I have issue:
exception 'Pheanstalk\Exception\ServerException' with message 'Job 5 NOT_FOUND: does not exist or is not reserved by client' in /var/www/site/vendor/pda/pheanstalk/src/Command/ReleaseCommand.php:63

My code executes about 77 s. I think, that is why I have this issue.
What can I do for fix this?
Help please.
Thks.


Reply to this email directly or view it on GitHub.

I did, as You recommend.

public function actionDoSome($job)
    {
        try {

            //some code
            return self::NO_ACTION;
        } catch (\Exception $exc) {
            return self::DELETE;
        }
    }

It is ok. But job running twice. And Job delete after second run, when exception catched.

I resolve my issue by this way

 Yii::$app->beanstalk->putInTube('doSome', $job, $priority, 0, $ttr);

where

$ttr = 600 (s).

Thanks, for your help.

Hi,

You welcome, an alternative approach would be set a timeout for the job when reserving.
checkout https://github.com/pda/pheanstalk/blob/master/src/Pheanstalk.php#L279
public function reserve($timeout = null)