Skip to content

Commit

Permalink
[BUGFIX] Avoid race condition in DI cache persistence
Browse files Browse the repository at this point in the history
With #90418 the container cache has been excluded from the
regular cache-flush-pipeline.
Therefore flushing has been explicitly performed when writing a
new cache entry (with the intent to clean up old cache entries).

Issue is: Cleaning up the entire folder by deleting the folder means
a concurrent request – that is creating the same DI cache as well –
will fail to write the cache when the folder is (re)moved in that
moment.

It turns out this cache-flush is not needed at all, since the cache
identifier is stable for an TYPO3 instance, therefore a pre-flight
flush can be dropped.

Releases: main, 12.4, 11.5
Resolves: #103294
Change-Id: I1267d794291899e2b0d551b1725bd4a3354823bd
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83261
Reviewed-by: Benjamin Franzke <ben@bnf.dev>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benjamin Franzke <ben@bnf.dev>
  • Loading branch information
bnf committed Mar 8, 2024
1 parent 41c3601 commit c530630
Showing 1 changed file with 0 additions and 7 deletions.
Expand Up @@ -29,13 +29,6 @@ public function flush()
// disable cache flushing
}

public function set($entryIdentifier, $data, array $tags = [], $lifetime = null)
{
// Remove stale cache files, once a new DI container was built
parent::flush();
parent::set($entryIdentifier, $data, $tags, $lifetime);
}

public function forceFlush(): void
{
parent::flush();
Expand Down

0 comments on commit c530630

Please sign in to comment.