laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.66k stars 11.04k forks source link

[11.x] Fix `withoutOverlapping` via `PendingEventAttributes` proxy #53553

Closed istiak-tridip closed 1 week ago

istiak-tridip commented 1 week ago

This PR addresses a bug with the withoutOverlapping method when used through the PendingEventAttributes proxy.

Example Code:

Schedule::runInBackground()
    ->withoutOverlapping()
    ->everyMinute()
    ->command('inspire');

The above throws the following exception:

Undefined property: Illuminate\Console\Scheduling\PendingEventAttributes::$mutex, vendor/laravel/framework/src/Illuminate/Console/Scheduling/ManagesAttributes.php, 145

This issue occurs during schedule execution, not at Event instance creation, so existing tests didn’t catch it.


Thanks to @decadence for reporting this bug.

decadence commented 1 week ago

Yes. With this fix Schedule doesn't throw Exception 👍