Fix race condition in Airplay stream cleanup (#2780)
authorMarvin Schenkel <marvinschenkel@gmail.com>
Tue, 9 Dec 2025 19:14:44 +0000 (20:14 +0100)
committerGitHub <noreply@github.com>
Tue, 9 Dec 2025 19:14:44 +0000 (20:14 +0100)
music_assistant/providers/airplay/protocols/airplay2.py
music_assistant/providers/airplay/protocols/raop.py

index 678ce2d8f9e81275a374058bd4424fd0ceaea1f7..e090ff46a8e95118ac4861359007d3c981e356f1 100644 (file)
@@ -159,4 +159,5 @@ class AirPlay2Stream(AirPlayProtocol):
             await asyncio.sleep(0)  # Yield to event loop
 
         # ensure we're cleaned up afterwards (this also logs the returncode)
-        await self.stop()
+        if not self._stopped:
+            await self.stop()
index 0d8bec5c953d4796e50547fee65dbc8ea6e995a8..d3cd558132b2ee27a9c8be56ff699c4d633fd027 100644 (file)
@@ -198,4 +198,5 @@ class RaopStream(AirPlayProtocol):
 
         # ensure we're cleaned up afterwards (this also logs the returncode)
         logger.debug("CLIRaop stderr reader ended")
-        await self.stop()
+        if not self._stopped:
+            await self.stop()