mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[PR #899] [MERGED] DLNA: Fix race condition leading to missing device names #8553
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?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/899
Author: @AThomsen
Created: 2/15/2019
Status: ✅ Merged
Merged: 2/16/2019
Merged by: @Bond-009
Base:
release-10.2.z← Head:bugfix/dlna_name_race_condition📝 Commits (1)
7bb8985Fix race condition in adding dlna devices to session when the device is discovered repeatedly📊 Changes
1 file changed (+5 additions, -5 deletions)
View changed files
📝
Emby.Dlna/PlayTo/PlayToManager.cs(+5 -5)📄 Description
Changes
On device discovery the current code checks if the session contains the discovered device. If it exists, nothing more is done. However, when a device is first discovered, different methods are called to (1) add the device to the session and (2) set the device's name.
This race condition can occur:
The code is not that easy to fix so the proposed patch simply moves the "is device already added" check inside the lock.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.