When a previous task failed e.g. on flushing entities all following tasks using doctrine will fail. The task bundle should use exec to have no sideeffects to other previous runned tasks.
This is needed bacause in symfony DI it is not able the reset the entity manager and other services which inject the entity manager will get the new reseted entity manager.
symfony/symfony#5339