-
-
Notifications
You must be signed in to change notification settings - Fork 52
Description
I've been hunting down a problem that was made more difficult due the "catch" clause at line 271 of WorkflowStub.php.
public function next($index, $now, $class, $result): void
{
try {
$this->storedWorkflow->logs()
->create([
'index' => $index,
'now' => $now,
'class' => $class,
'result' => Serializer::serialize($result),
]);
} catch (QueryException) {
// already logged
}
$this->dispatch();
}
In my case, I had a workflow that was repeating forever. It never failed, no exceptions were add to the exceptions table, and no events were dispatched for a failed activity. The activity just seemed to be started over and over.
I eventually added some logging in the catch statement above and caught this error:
SQLSTATE[08S01]: Communication link failure: 1153 Got a packet bigger than 'max_allowed_packet' bytes (Connection: mysql, SQL: insert into
workflow_logs (
index,
now,
class,
result,
stored_workflow_id,
created_at) values (3, 2025-03-18 23:09:06.000000, App\MyAction, base64:....VERY LONG BASE64 ....
...
What exception is being ignored in the try/catch with next()
? Can the catch either be removed or else be made specific to only the exact exception that would indicate that the activity was already logged? If the catch statement was not here, my debugging would have been made easier. When used in production, I would also feel more comfortable if we were not blindly ignoring exceptions.