Race condition in LocalTaskManager::getLocalTasks() with fibers

Created on 20 October 2025, 3 months ago

Problem/Motivation

There are typically two blocks that display local tasks, primary and secondary. They essentially rely on the same static cache and access different data within.

The return value for a miss in the static cache is immediately initialized. If the access checks for those local tasks result in a fiber suspension, then the other blocks is built, which requests the local tasks for the same route and then immediately gets an empty list back.

Steps to reproduce

Enable webform and entity_usage on 11.x, enable entity usage for webforms. Secondary local tasks are somewhat uncommon, this specific combination loads a webform for the usage local task (and because it doesn't load it override free, it doesn't hit the existing static cache)

Either the primary or secondary local tasks will now be missing.

Proposed resolution

Add a fiber suspend if we're in a fiber and already calculating local tasks? Fairly straightforward fix, but I am concerned that we're going to hit more cases like this with static caches.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

menu system

Created by

🇨🇭Switzerland berdir Switzerland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Merge request !13539Fix LocalTaskManager race condition → (Closed) created by berdir
  • Pipeline finished with Failed
    3 months ago
    Total: 564s
    #633666
  • Pipeline finished with Success
    3 months ago
    Total: 822s
    #633681
  • Pipeline finished with Failed
    3 months ago
    Total: 858s
    #633812
  • Pipeline finished with Success
    3 months ago
    Total: 589s
    #651919
  • Pipeline finished with Failed
    about 1 month ago
    Total: 192s
    #689343
  • Pipeline finished with Success
    about 1 month ago
    Total: 2265s
    #689360
  • Pipeline finished with Failed
    about 1 month ago
    Total: 454s
    #689800
  • Pipeline finished with Success
    about 1 month ago
    #689809
  • Status changed to RTBC about 1 month ago
  • Pipeline finished with Success
    29 days ago
    Total: 2723s
    #693326
Production build 0.71.5 2024