From c809e46c9c00abd924d3b2ffed4f627b632fb061 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Sun, 22 Feb 2026 14:53:11 +0100 Subject: [PATCH] Fix issue with subprocess pips closing --- music_assistant/helpers/process.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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) -- 2.34.1