-
-
Notifications
You must be signed in to change notification settings - Fork 289
Closed
Labels
type:bugBugBug
Description
Description
Invoking the canRetry method with a null $error argument value which is introduced in #528 is a major issue and can break existing implementations of canRetry. The definition of RetryableJobInterface clearly states:
* @param int $attempt The attempt number
* @param \Exception|\Throwable $error The error from the last execution of the job
In our jobs, we rely on the error instance to determine whether a job should be retried. Calling canRetry with a null error value and ignoring the job's failure has already led to significant data loss.
Example of an existing implementation that depends on the error:
/**
* Defines if the job can be retryed automatically.
*/
public function canRetry($attempt, $error): bool
{
if ($error instanceof SpecificException) {
if ($attempt < 12) {
return true;
}
}
return false;
}
The change alters the contract of the interface in a backward-incompatible way and undermines the intended retry logic.
Package version
2.3.8
PHP version
8.4.15
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type:bugBugBug