You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closure in job Bus::chain is not called if it is after Bus::batch - exception is thrown but there is nothing in failed jobs. Call to undefined method Closure::getClosure() {"exception":"[object] (Error(code: 0): Call to undefined method Closure::getClosure() at /home/eldair/code/bus_chain_test/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedClosure.php:107)
Steps To Reproduce
Batch setup
$batch = [];
for ($i=0; $i < 5; $i++) {
$batch[] = new BatchJob($i + 1);
}
This will throw the exception and the closure will not be called
Bus::chain([
new ChainedJob,
Bus::batch($batch),
function () {
logger('after batch');
}
])->dispatch();
This works fine
Bus::chain([
new ChainedJob,
Bus::batch($batch),
new ChainedJob,
function () {
logger('after batch');
}
])->dispatch();
As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.
If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.
In my opinion, the problem is that the serializable-closure library incorrectly handles the case when SerializableClosure is used as a property type inside another SerializableClosure.
Laravel Version
11.11.1
PHP Version
8.3.8
Database Driver & Version
No response
Description
Closure in job Bus::chain is not called if it is after Bus::batch - exception is thrown but there is nothing in failed jobs.
Call to undefined method Closure::getClosure() {"exception":"[object] (Error(code: 0): Call to undefined method Closure::getClosure() at /home/eldair/code/bus_chain_test/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedClosure.php:107)
Steps To Reproduce
Batch setup
This will throw the exception and the closure will not be called
This works fine
Here is the reproduction repo https://github.com/eldair/bus_chain_test/tree/main, nothing was added except two jobs and console command to call the code above.
The text was updated successfully, but these errors were encountered: