-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
Closed
Milestone
Description
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
Labels
No labels