Queue just stop executing job and therefore (MySQL server has gone away)
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.1k
- Forks
- 285
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
Just a regular case of using queue.
Normal behavior, with no worker hanging.
I get MySQL server has gone away.
yii queue/listen --verbose --color --isolate=0 if I use isolated mode It can work about 6 days and dies, if I use isolated=1 It dies every day. Having default TTR 30
IMPORTANT there no errors before I push ENTER button on console, only after intercation with console this error shown, otherway I just see there nothing happend and can detect process is down only by checking MYSQL process exists. . I assume worker didnt get signal that process gone and wait for it infinitely until wait_timeout reached
SHOW VARIABLES WHERE variable_name LIKE '%timeout%'
yii queue/listen --verbose --color --isolate=0
CreateReport.php
public function execute($queue)
{
\Yii::info([
'status' => 'started',
'id_gtin' => $this->id_gtin,
], 'create');
$model = new \app\models\Report();
$model->id_gtin = $this->id_gtin;
$model->id_type = $this->id_type;
$model->date_start = $this->date_start;
$model->date_end = $this->date_end;
$model->setBatches($this->id_batches);
// When creating model we do HTTP request to outer API, and waiting for response, only after we save model.
if ($model->save()) { ... }
As you can see there is a Yii log should be written right after executing started, but I didnt see this log, so the job didnt executed at all, but has a flag with 1 attemp.
MYSQL LOG
php.ini
t.
console.php
Server
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the yii queue/listen --verbose --color --isolate=0 entry point and review the CreateReport.php job, especially where its initial Yii log and model save occur. Check how console.php configures the worker and MySQL connection, then reproduce the silent stop and verify that the job reports an error instead of remaining marked as attempted without execution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- backend, cli, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100