Skip to content
Snippets Groups Projects
Commit 55c917ca authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[BUGFIX] Release locks in middleware to prevent locking deadlock

In the frontend middleware chain PrepareTypoScriptFrontendRendering
interacts with TSFE and calls getFromCache() which acquires frontend
rendering locks. Locks are usually released after TSFE rendering in
the final middleware, the HTTP/RequestHandler.

Middleware ShortcutAndMountPointRedirect however, wich is called
after PrepareTypoScriptFrontendRendering, can return early without
calling below middlewares. In this case, locks need to be explicitly
released to prevent a deadlock.

This is not an issue in normal frontend calls since acquired locks
are always released in __destruct() of the locking API.

But, if the frontend is called as sub request, for instance from
within another frontend call, from cli or testing, the lock API
destructors may or may not be called. If not, this leads to dangling
locks after the FE sub request, which then may block a following sub
request executed in the same process.

Resolves: #92882
Releases: master, 10.4
Change-Id: I231e56fb04ffa899c6e1b4d7e1a9e4a971f632db
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66707


Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent d2c52d56
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment