Review 10.4 Merged

66713[BUGFIX] Release locks in middleware to prevent locking deadlock

Christian Kuhn CR +2 V +2 Easy +14 −0 updated 11/20/20, 10:32

Commit message

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.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 1