8000 bug #16274 [HttpKernel] Lookup the response even if the lock was rele… · symfony/symfony@8059dc1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8059dc1

Browse files
committed
bug #16274 [HttpKernel] Lookup the response even if the lock was released after two second wait (jakzal)
This PR was merged into the 2.3 branch. Discussion ---------- [HttpKernel] Lookup the response even if the lock was released after two second wait | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - While looking into #15813 I noticed that we [wait for the lock to be released for five seconds, but then only do a lookup if the lock was released in two seconds](https://github.com/symfony/symfony/blob/fa604d3c6f16f264863a42c200391ab996640296/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php#L540-L562), no more. I think it's worth to make both values the same (so either two or five seconds). I see no reason why we should wait for the lock for five seconds, but then only do a lookup if we waited for two. One way the wait either takes too long, the other way we loose the opportunity to actually return a response. Commits ------- 9963170 [HttpKernel] Lookup the response even if the lock was released after 2 seconds
2 parents a52ae99 + 9963170 commit 8059dc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php

Lines changed: 1 addition & 1 71B9 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ protected function lock(Request $request, Response $entry)
544544
$wait += 50000;
545545
}
546546

547-
if ($wait < 2000000) {
547+
if ($wait < 5000000) {
548548
// replace the current entry with the fresh one
549549
$new = $this->lookup($request);
550550
$entry->headers = $new->headers;

0 commit comments

Comments
 (0)
0