Problem/Motivation
The active trail cache collector stores the calculated active trail per route + parameters for all menus on a page.
Even though it's a per route + params cache, this is used for the active trail cache context which is used to determine render cache IDs, so we probably need to keep the cache. #3529464: Make menu trail behaviour in SystemMenuBlock optional would make it possible to skip this logic entirely.
We can skip cache collector locking here because the cache isn't additive - i.e. it's not accumulating across multiple pages, it's just collecting the same handful of things per page. Also the chances of multiple requests all trying to build the same item are quite low anyway, and even if that happens occasionally, it would be outweighed by all the lock acquires and releases when it doesn't happen.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3560670
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3560670-dont-lock-on
changes, plain diff MR !13996
Comments
Comment #3
catchComment #4
catchComment #5
berdirWith that logic, do we need to use the CacheCollector at all, can't we just use a regular cache lookup then? Is it just for the static cache in case of multiple requests? That could use a backend chain then?
Comment #6
catchThe cache collector still handles collecting (sorry) the various active trails that are requested via menus during the request, which would be harder to do without it.
Comment #7
berdirThat makes sense. Perfomance tests conflict, but happy to RTBC after this.
Comment #8
catch#3529464: Make menu trail behaviour in SystemMenuBlock optional affects the same lock queries in the same performance tests, hoping to land that one first because it has much wider impact (if you configure it).
Comment #10
catchRebased, taking @berdir's #7 as a license to RTBC this. Only standard performance tests need updating now because Umami doesn't use the active trail at all after #3529464: Make menu trail behaviour in SystemMenuBlock optional.
Comment #14
alexpottCommitted 19ea228 and pushed to main. Thanks!
Committed e316198 and pushed to 11.x. Thanks!