mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[PR #10801] AsyncKeyedLock migration #12615
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/jellyfin/jellyfin/pull/10801
State: closed
Merged: Yes
Switching the existing locking mechanism to use the AsyncKeyedLock library which has been heavily tested and benchmarked, offering superior performance and lower memory allocations (mainly due to the object pooling), while extra care ensured against race conditions.
Changes
Jellyfin now uses a more streamlined approach to locking concurrent tasks by key.
Issues
Replaces #9132
Note to reviewer: there are a number of
ifstatements that happen within the locks. I left them as is so as not to affect functionality but it is quite likely that it would be possible for you to put theifoutside/enclosing the lock, leading to a performance gain. @JPVenson