Skip to content

Request to not blindly ignore exceptions when storing Activity results into Logs table #221

@travisaustin

Description

@travisaustin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy