+ // We need to store the updated batch information in the batch storage after
+ // processing the batch. In order for the error page to work correctly this
+ // needs to be done even in case of a PHP fatal error in which case the end of
+ // this function is never reached. Therefore we register a shutdown function
+ // to handle this case. Because with FastCGI and fastcgi_finish_request()
+ // shutdown functions are called after the HTTP connection is closed, updating
+ // the batch information in a shutdown function would lead to race conditions
+ // between consecutive requests if the batch processing continues. In case of
+ // a fatal error the processing stops anyway, so it works even with FastCGI.
+ // However, we must ensure to only update in the shutdown phase in this
+ // particular case we track whether the batch information still needs to be
+ // updated.
+ // @see _batch_shutdown()
+ // @see \Symfony\Component\HttpFoundation\Response::send()