Skip to content

exit() doesn't stop the worker script #1590

@dunglas

Description

@dunglas

What happened?

A call to exit() should stop and restart the worker script, but this isn't currently the case.

With a simple Symfony controller like this, $i should always be 0, but it is actually incrementing.

namespace App\Controller;

use Symfony\Component\Routing\Attribute\Route;

class HomeController
{
    #[Route('/')]
    public function __invoke(): string
    {
        static $i = 0;
        $i++;
        echo 'Hello '.$i;
        exit(0);
    }
}

This is likely the root cause of #1553, dunglas/symfony-docker#792, and dunglas/symfony-docker#773

Maybe @AlliBalliBab,a you have a clue of what's going on?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions