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

Start Time Is Not Reset During Kernel Reboot #27319

Copy link
Copy link
Closed
@kiler129

Description

@kiler129
Issue body actions

Symfony version(s) affected: 4.1-beta1, master

Description
I started using Symfony with ReactPHP and discovered rather unusual behavior. While requests were lightning fast the profiler was more and more upset with each request.

screenshot 2018-05-19 21 20 06

screenshot 2018-05-19 21 08 35

screenshot 2018-05-19 21 08 40

screenshot 2018-05-19 21 09 15

How to reproduce

  1. Create kernel
  2. Reboot kernel
  3. Handle request
  4. Terminate kernel
  5. Go to step 2

Possible Solution
I started digging and apparently \Symfony\Component\HttpKernel\DataCollector\TimeDataCollector calculates times based on Kernel::getStartTime() with fallback to request start time. While this approach works when kernel is created and destroyed during the request rebooting kernel doesn't cause TimeDataCollector to reflect the rebooted kernel state.

Workaround is simple - overwriting reboot(). However I think we should fix this in abstract kernel by calling $this->startTime = microtime(true); in reboot() just before boot() like so:

    public function reboot($warmupDir)
    {
        $this->shutdown();
        $this->warmupDir = $warmupDir;

        if ($this->debug) {
            $this->startTime = microtime(true);
        }
        
        $this->boot();
    }

WDYT?

Metadata

Metadata

Assignees

No one assigned

    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.