This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/HttpKernel
Fabien Potencier 526fd9fc44 feature #33701 [HttpKernel] wrap compilation of the container in an opportunistic lock (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] wrap compilation of the container in an opportunistic lock

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

https://github.com/symfony/symfony/pull/32764#issuecomment-516924305

This PR adds a lock around the compilation of the container. When two or more concurrent requests want to compile the container, the first one runs the computation and the others wait for its completion. If for any reasons the lock doesn't work, compilation happens as usual.

The effect is visible when developing locally:

Here is what all concurrent requests consume now:
![image](https://user-images.githubusercontent.com/243674/65603626-4e231d00-dfa6-11e9-8b6c-62dbd5eb30fe.png)

And here is what they will consume with this PR (they wait but reuse the just compiled container):
![image](https://user-images.githubusercontent.com/243674/65603733-7f9be880-dfa6-11e9-930b-ce793c3e280c.png)

Commits
-------

0b5b3ed7f9 [HttpKernel] wrap compilation of the container in an opportunistic lock
2019-10-02 10:09:14 +02:00
..
Bundle Add return types to internal|final|private methods 2019-08-20 17:32:53 +02:00
CacheClearer fixed CS 2019-01-16 19:35:49 +01:00
CacheWarmer Add return types to internal|final|private methods 2019-08-20 17:32:53 +02:00
Config [HttpKernel] deprecate global dir to load resources from 2019-08-21 00:57:10 +02:00
Controller Add ErrorController to preview and render errors 2019-09-02 17:02:21 -04:00
ControllerMetadata Merge branch '4.3' into 4.4 2019-08-26 11:00:56 +02:00
DataCollector Merge branch '4.3' into 4.4 2019-08-26 11:00:56 +02:00
Debug Merge branch '3.4' into 4.3 2019-09-08 22:39:53 +02:00
DependencyInjection [HttpKernel] fix compat with legacy DebugClassLoader 2019-09-10 17:04:34 +02:00
Event Mark all dispatched event classes as final 2019-08-21 17:17:54 +02:00
EventListener [4.4] Fix some leftovers 2019-09-30 11:07:05 +02:00
Exception Merge branch '3.4' into 4.3 2019-08-14 14:26:46 +02:00
Fragment Merge branch '4.3' into 4.4 2019-08-20 16:44:19 +02:00
HttpCache Merge branch '4.3' into 4.4 2019-08-26 11:00:56 +02:00
Log Import return annotations from vendors 2019-08-14 15:27:41 +02:00
Profiler [HttpKernel] compress files generated by the profiler 2019-09-25 10:55:08 +02:00
Resources Minor tweaks 2019-09-23 09:09:39 -04:00
Tests [FrameworkBundle] WebTestCase KernelBrowser::getContainer null return type 2019-09-27 12:05:31 +02:00
.gitattributes Adding .gitattributes to remove Tests directory from "dist" 2019-09-16 10:12:51 +02:00
.gitignore Fix gitignore 2014-03-04 18:06:29 +01:00
CHANGELOG.md [FrameworkBundle] WebTestCase KernelBrowser::getContainer null return type 2019-09-27 12:05:31 +02:00
Client.php Merge branch '4.3' into 4.4 2019-09-10 13:27:29 +02:00
composer.json Allow Twig 3 2019-09-23 16:04:59 +02:00
HttpClientKernel.php [4.4] Add return types on internal|final|private methods (bis) 2019-08-20 23:22:06 +02:00
HttpKernel.php Add return types to internal|final|private methods 2019-08-20 17:32:53 +02:00
HttpKernelBrowser.php [HttpKernel] Fix missing use for request and response classes 2019-06-06 17:13:36 +03:00
HttpKernelInterface.php removed unneeded phpdocs 2019-08-06 08:19:29 +02:00
Kernel.php feature #33701 [HttpKernel] wrap compilation of the container in an opportunistic lock (nicolas-grekas) 2019-10-02 10:09:14 +02:00
KernelEvents.php [EventDispatcher] swap arguments of dispatch() to allow registering events by FQCN 2019-03-14 08:32:46 +01:00
KernelInterface.php [FrameworkBundle] WebTestCase KernelBrowser::getContainer null return type 2019-09-27 12:05:31 +02:00
LICENSE update year in license files 2019-01-01 14:45:19 +01:00
phpunit.xml.dist Bump phpunit XSD version to 5.2 2018-11-11 12:18:13 +01:00
README.md Updated all the README files 2016-03-04 08:12:06 +01:00
RebootableInterface.php [HttpKernel][FrameworkBundle] Add RebootableInterface, fix and un-deprecate cache:clear with warmup 2017-08-18 13:51:16 +02:00
TerminableInterface.php [DI] minor docblock fixes 2017-10-24 13:40:19 +02:00
UriSigner.php add parameter type declarations to private methods 2019-07-31 20:51:46 +02:00

HttpKernel Component

The HttpKernel component provides a structured process for converting a Request into a Response by making use of the EventDispatcher component. It's flexible enough to create a full-stack framework (Symfony), a micro-framework (Silex) or an advanced CMS system (Drupal).

Resources