Skip to content

Fatal Errors in task are not recognized #19

@sascha-egerer

Description

@sascha-egerer

If a task fails with a PHP fatal error this error is not recognized but "ignored".

In my case i have a fatal error due to exhausted memory. This kind of error is currently not logged nor reported somehow.

Test case:
Just add this code to a execute() of command

        $myArray = [];
        while (true)
        {
            $myArray[] = array_fill(0, 1000000, "z");
        }

Run

$ vendor/bin/typo3 crontab:execute my_command

You'll get something like

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 33554440 bytes) in /a/b/c/MyCommand.php on line 77

Now run:

$ vendor/bin/typo3 -vvv crontab:run
Executing scheduled tasks…
done.

Command is successful and there is nothing logged to the logger but the underlying task failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions