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
Two related issues exist with scheduled task failure events:
**Original Issue:**The ScheduledTaskFailed event doesn't dispatch consistently across all failure modes (exceptions, non-zero exit codes, background/system failures). While [12.x]ScheduledTaskFailed not dispatched on scheduled task failing #55572 addressed part of this, there's still inconsistent behavior. thus it was reverted.
**New runInBackground Issue:**When using ->runInBackground(), commands don't properly return status codes, causing exceptions in the scheduler. This prevents proper failure event dispatching for background tasks.
Laravel Version
12.x
PHP Version
8.4
Database Driver & Version
No response
Description
Description
Two related issues exist with scheduled task failure events:
**Original Issue:**The ScheduledTaskFailed event doesn't dispatch consistently across all failure modes (exceptions, non-zero exit codes, background/system failures). While [12.x]
ScheduledTaskFailed
not dispatched on scheduled task failing #55572 addressed part of this, there's still inconsistent behavior. thus it was reverted.**New runInBackground Issue:**When using ->runInBackground(), commands don't properly return status codes, causing exceptions in the scheduler. This prevents proper failure event dispatching for background tasks.
Steps to Reproduce
For Issue #1:
For Issue #2:
Expected Behavior
All task failures (including background jobs) should dispatch ScheduledTaskFailed
Background tasks should properly report their status without throwing scheduler exceptions
Actual Behavior
Some failure modes still don't trigger the event
Background tasks cause scheduler exceptions instead of clean failure reporting
Root Cause
Incomplete failure state handling in the scheduler's execution flow
Background process status checking isn't properly integrated with the event system
Suggested Solution
Need to:
Expand the scheduler's failure detection to cover all edge cases
Properly handle background process status returns
Ensure consistent event dispatching regardless of execution method
Steps To Reproduce
and for the second issue
The text was updated successfully, but these errors were encountered: