From: Marcel van der Veldt Date: Sun, 22 Feb 2026 13:53:11 +0000 (+0100) Subject: Fix issue with subprocess pips closing X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=c809e46c9c00abd924d3b2ffed4f627b632fb061;p=music-assistant-server.git Fix issue with subprocess pips closing --- diff --git a/music_assistant/helpers/process.py b/music_assistant/helpers/process.py index a1287efa..75cc310c 100644 --- a/music_assistant/helpers/process.py +++ b/music_assistant/helpers/process.py @@ -359,14 +359,13 @@ class AsyncProcess: with suppress(asyncio.CancelledError, Exception): await self._stderr_reader_task - # Close all pipes first to prevent any I/O blocking - # This helps processes stuck on blocked I/O to receive signals + # Close stdin to signal we're done sending data + # Note: Don't manually call feed_eof() on stdout/stderr - this causes + # "feed_data after feed_eof" assertion errors when the subprocess transport + # still has buffered data to deliver. Let the process termination naturally + # close the streams. if self.proc.stdin and not self.proc.stdin.is_closing(): self.proc.stdin.close() - if self.proc.stdout: - self.proc.stdout.feed_eof() - if self.proc.stderr: - self.proc.stderr.feed_eof() # Send SIGKILL immediately using os.kill for more direct signal delivery self.logger.debug("Killing process %s with PID %s", self.name, pid)