yiisoft / yii2-queue

Yii2 Queue Extension. Supports DB, Redis, RabbitMQ, Beanstalk and Gearman
BSD 3-Clause "New" or "Revised" License
1.07k stars 295 forks source link

The queue task was delayed in ttr seconds #438

Open huangli58 opened 3 years ago

huangli58 commented 3 years ago

What steps will reproduce the problem?

I set parameter ttr=7200, seconds。 I found a strange phenomenon that the task was not wrong but it was executed after 7200 seconds. My config like this: 'dataExport' => [ 'class' => yii\queue\redis\Queue::class, 'channel' => 'dataExportQueue', 'as log' => common\behaviors\QueueLogBehavior::class, 'ttr' => 7200, ],

What's expected?

I guess it should execute immediately but I didn t get task feedback.

What do you get instead?

Additional info

huangli58 commented 3 years ago

Normally, the Queue were executed immediately and delayed only a few times.

yii-bot commented 3 years ago

Thanks for posting in our issue tracker. In order to properly assist you, we need additional information:

Thanks!

This is an automated comment, triggered by adding the label status:need more info.

huangli58 commented 3 years ago

When does the issue occur? When I push a task to the queue it happens.

What do you see? The task was not performed immediately.After 7200 seconds I found the update record in the database and I knew it was executed and I prepared to calculate the time it was executed after ttr seconds.

What was the expected result? I expected it to execute immediately but it was not immediately and there was no relevant error.

Can you supply us with a stacktrace? (optional)

Do you have exact code to reproduce it? Maybe a PHPUnit tests that fails? (optional)

samdark commented 3 years ago

Does that happen with any task every time? In order to fix an issue we need to somehow reproduce it.

huangli58 commented 3 years ago

No.It is normal for a long time, occasionally such problems.I have no way to reproduce it either.

I'm not sure if this is related to supervisor as I use it as a process management for Yii Queue and the odd phenomenon is that when Queue was delayed after ttr seconds I found that supervisor restarted Yii Queue.

samdark commented 3 years ago

That should be connected.

huangli58 commented 3 years ago

Is there any good solution