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)