Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[RFC][WebProfilerBundle] Slow kernel.terminate can prevent Toolbar from loading #25849

Copy link
Copy link
Closed
@JoeKre

Description

@JoeKre
Issue body actions
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version >= 3.4

I would like to get your opinion concerning the WebDebugToolbar and potentially long running kernel.terminate events when sending spooled mails which "breaks" the toolbar

The scenario can be described as follows:

When using the SwiftMailerBundle with any type of spooling active i.e. spool: { type: memory } the actual sending will be done through Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener before the kernel is actually terminated.

This will lead to the EmailSenderListener blocking the kernel termination until the response from your email provider is fully processed.
Until the kernel is fully terminated the profile for the given token cannot be loaded.
While this is happening the toolbar might already try to load the profile data through its ajax call.

Based on the performance of the email provider or any potential SwiftMailer plugins it can happen that the WebDebugToolbar will quit after the 5 tries to load the profile and show the error instead.

Two possible fixes for this problem could be to either:

  • increase the number of retries for the ajax call (possibly through a configurable value)

or

  • add a small delay before sending the 404 if the profile could not be loaded and create more time for kernel.terminate to finish running.

Simplified example in Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController::toolbarAction

if (!$profile = $this->profiler->loadProfile($token)) {
    sleep(1);
    return new Response('', 404, array('Content-Type' => 'text/html'));
}

Is there any need to fix this "problem" which is mildly annoying although it's not actually a bug in the profiler?
If someone should fix it, or rather give the toolbar more leeway to load the profile data, which way would be a preferred one?

kind regards
Joe

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)WebProfilerBundle

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.