1

i have a issue with Event Dispatcher on Symfony4. The script contnues 25 seconds after the event finished . Here the code:

controller (necessary part):

$this->logger->notice("Log Start");
$response = new JsonResponse($responseArray, 200);
$this->eventDispatcher->dispatch(new FilterUserResponseEvent($user, $request, $response), FOSUserEvents::REGISTRATION_COMPLETED);
$this->logger->notice("Log End");

EventSubscriber (necessary part):

$this->logger->notice("REGISTRATION_COMPLETED Start");
...
$this->logger->notice("REGISTRATION_COMPLETED End");

The results of the logs is:

10:00:00 Log Start
10:00:00 REGISTRATION_COMPLETED Start
10:00:00 REGISTRATION_COMPLETED End
10:00:25 Log End

how is this possible? in my script there is nothing between the end of the event and the other log. maybe it is a symfony core bug? I want to say that it is not systematic, it happens sometimes.

thanks for your help!

AndreaS
  • 11
  • 1
  • Have you checked whether there are other event listeners who might also listen to your event? Symfony's profiler might show all of them, including a proper timeline – Nico Haase Oct 08 '20 at 12:44
  • Unfortunately, this situation is found only on the production server. I'm trying to replicate it in testing in order to debug like you said. – AndreaS Oct 08 '20 at 13:12

0 Answers0