Skip to content

Investigate Deadlock Prevention in WpApiCache::execute() #1023

@oguzkocer

Description

@oguzkocer

The WpApiCache::execute() function can deadlock when nested calls are made through cloned cache references. While the docs note this is "unlikely to write accidentally," it's still possible in real scenarios like callback chains or cross-crate usage.

let cache2 = cache.clone();
cache.execute(|conn| {
    cache2.execute(|conn2| { ... })  // ⚠️ Deadlock!
})?;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions