Problem/Motivation
At the moment on a large site, the menu rebuild can take a long time. menu_rebuild() acquires a lock and makes everything else wait until it's done before rending pages, meaning the entire site can end up completely locked and un-usable.
My specific problem is on saving a view which is being used as a reporting tool in a web application, so there are almost certainly things that views can do to help reduce this problem, but it seems to me that is is also a problem worth solving in core.
Proposed resolution
Allow requests that happen during the rebuild to use the 'old' cache of the menu while the new one is being built so the site continues to function.
I have created this against 7.x-dev as I don't know whether this issue is relevant for 8.x...
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2129943-1-dont_lock_entire_site_in_menu_rebuild.patch | 857 bytes | andrewbelcher |
Comments
Comment #1
andrewbelcher commentedHere is a possible solution. By unsettling the
menu_rebuild_neededvariable, subsequent calls to menu_get_item() will use the old cache rather than also trying to rebuild the menu.I am expecting someone with more knowledge of the menu router to give a bunch of reasons why this solution wouldn't work, but hopefully it can start a discussion on a solution that would work.