diff --git a/core/lib/Drupal/Core/Routing/RouteBuilder.php b/core/lib/Drupal/Core/Routing/RouteBuilder.php index e9692c5..e235e39 100644 --- a/core/lib/Drupal/Core/Routing/RouteBuilder.php +++ b/core/lib/Drupal/Core/Routing/RouteBuilder.php @@ -135,6 +135,11 @@ public function rebuild() { $this->lock->wait('router_rebuild'); if ($this->routeBuilderIndicator->isRebuildStillNeeded()) { + // Per default the lock waits for 30 seconds. In case we haven't + // completed in the meantime, try to rebuild again. In case the + // rebuilding needs an incredible long time, and the callstack by this + // recursive call gets high, you already have a problem with your + // site being down for a long long time. $this->rebuild(); } @@ -220,6 +225,12 @@ public function getCollectionDuringRebuild() { */ public function rebuildIfNeeded() { if ($this->routeBuilderIndicator->isRebuildNeeded()) { + // In case we need to rebuild the router, absolutely ensure that we need + // to rebuild the router. There is the small chance (which gets high in + // case there are a lot of requests to the page), that we have actually + // completed the rebuild in the meantime, but the internal indicator + // (for example state) is still static cached in this process. Therefore + // use an safe, but slow way, to check whether the rebuild is needed. if (!$this->routeBuilderIndicator->isRebuildStillNeeded()) { return FALSE; }