Skip to content

remove locked_cached_property #4993

@davidism

Description

@davidism

locked_cached_property is a modification of cached_property that acquires a lock before interacting with its data. Due to the way descriptors work, even though the property is "cached", each access still invokes the descriptor's __get__ method and acquires the lock. Therefore, when using thread-like workers that share the lock, requests can block each other. These blocks should be very brief, as they're only immediately returning the cached property, but it's still inefficient.

It is currently applied to app.jinja_env, app.logger, app.name, app.jinja_loader, and blueprint.jinja_loader. I'm not entirely sure we need locks on them at all, but just in case we could use locks within the methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions