codeigniter4 / queue Goto Github PK
View Code? Open in Web Editor NEWQueues for the CodeIgniter 4 framework
Home Page: https://queue.codeigniter.com/
License: MIT License
Queues for the CodeIgniter 4 framework
Home Page: https://queue.codeigniter.com/
License: MIT License
[ErrorException]
Undefined array key 0
at VENDORPATH\codeigniter4\queue\src\Commands\QueuePublish.php:21
Issue Description:
I have identified a bug in the CodeIgniter 4 queue system. When a task fails during execution, and that task involves a transaction, it fails to log the failure in the designated log file.
class ExampleJob
{
public function process(string $data):
{
$db = db_connect();
$db->transStart(); // Start Transaction
// Job logic here and get RuntimeException
}
}
When a job fails to execute, the system fails to log the failure in the queue_jobs_failed
table. Furthermore, when utilizing the DatabaseHandler, the job record remains unremoved from the queue_jobs
table.
This oversight results in a lack of visibility into failed jobs and may lead to potential data inconsistency within the job management system.
When retrieving jobs in a queue the function skipLocked() is called (QueueJobModel.php). The sql addon "FOR UPDATE SKIP LOCKED" is not available in new but not the newest MariaDB versions. This causes a "FALSE" on the query leading to an empty queue. Perhaps it's better to throw an exception than. Returning zero jobs is confusing.
MariaDb 10.5 not work query
SELECT *
FROM `queue_jobs`
WHERE `queue` = 'price_import'
AND `status` = 0
AND `available_at` <= 1707854930
AND `priority` IN ('default')
ORDER BY `available_at` ASC, `id` ASC
LIMIT 1 FOR UPDATE SKIP LOCKED
CodeIgniter\CLI\CLI::print(): Argument #1 ($text) must be of type string, int given, called in \vendor\codeigniter4\queue\src\Commands\QueueWork.php on line 164
at SYSTEMPATH\CLI\CLI.php:449
Backtrace:
1 VENDORPATH\codeigniter4\queue\src\Commands\QueueWork.php:164
CodeIgniter\CLI\CLI::print()
2 SYSTEMPATH\CLI\Commands.php:65
CodeIgniter\Queue\Commands\QueueWork()->run()
3 SYSTEMPATH\CLI\Console.php:46
CodeIgniter\CLI\Commands()->run()
4 ROOTPATH\spark:102
CodeIgniter\CLI\Console()->run()
Undefined array key "retyAfter"
at VENDORPATH\codeigniter4\queue\src\Commands\QueueWork.php:206
This causes the following PHPStan (phpstan-codeigniter) error.
------ ---------------------------------------------
Line app/Events/NewPostEvent.php
------ ---------------------------------------------
66 Service method 'queue' returns mixed.
๐ก Perhaps you forgot to add a return type?
------ ---------------------------------------------
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.