[PR #10801] AsyncKeyedLock migration #12615

Closed
opened 2026-02-07 06:58:55 +03:00 by OVERLORD · 0 comments
Owner

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 if statements 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 the if outside/enclosing the lock, leading to a performance gain. @JPVenson

**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 `if` statements 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 the `if` outside/enclosing the lock, leading to a performance gain. @JPVenson
OVERLORD added the pull-request label 2026-02-07 06:58:55 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#12615