From: Marcel van der Veldt Date: Mon, 8 Apr 2024 13:39:56 +0000 (+0200) Subject: prevent hang on stop of cliraop X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=10f8dec2694f886ee94656489e648720f654126d;p=music-assistant-server.git prevent hang on stop of cliraop --- diff --git a/music_assistant/server/providers/airplay/__init__.py b/music_assistant/server/providers/airplay/__init__.py index a5ea4e8e..4adab756 100644 --- a/music_assistant/server/providers/airplay/__init__.py +++ b/music_assistant/server/providers/airplay/__init__.py @@ -280,7 +280,14 @@ class AirplayStream: self.audio_source_task.cancel() if not self._cliraop_proc.closed: await self.send_cli_command("ACTION=STOP") - await self._cliraop_proc.wait() + try: + await asyncio.wait_for(self._cliraop_proc.wait(), 5) + except TimeoutError: + self.prov.logger.warning( + "Raop process for %s did not stop in time, is the player offline?", + self.airplay_player.player_id, + ) + await self._cliraop_proc.close(True) # ffmpeg can sometimes hang due to the connected pipes # we handle closing it but it can be a bit slow so do that in the background