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

The queue task was delayed in ttr seconds

Open huangli58 opened this issue 3 years ago • 7 comments

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 avatar Oct 26 '21 07:10 huangli58

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

huangli58 avatar Oct 26 '21 07:10 huangli58

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

  • When does the issue occur?
  • What do you see?
  • What was the expected result?
  • Can you supply us with a stacktrace? (optional)
  • Do you have exact code to reproduce it? Maybe a PHPUnit tests that fails? (optional)

Thanks!

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

yii-bot avatar Oct 26 '21 21:10 yii-bot

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)

huangli58 avatar Oct 27 '21 02:10 huangli58

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

samdark avatar Oct 27 '21 06:10 samdark

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.

huangli58 avatar Oct 28 '21 01:10 huangli58

That should be connected.

samdark avatar Oct 28 '21 06:10 samdark

Is there any good solution

huangli58 avatar Oct 28 '21 08:10 huangli58