From 09808f41ed95a8292a3e5a246347072d75a39292 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 31 Mar 2026 07:09:12 +0000 Subject: [PATCH] Increasing pipe buffer size for non win32 machines --- render_machine/render_utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/render_machine/render_utils.py b/render_machine/render_utils.py index f7d8dcb..2bf2564 100644 --- a/render_machine/render_utils.py +++ b/render_machine/render_utils.py @@ -1,3 +1,4 @@ +import fcntl import os import signal import subprocess @@ -18,6 +19,8 @@ POLL_INTERVAL_SECONDS = 0.2 SIGTERM_GRACE_PERIOD_SECONDS = 0.2 STDOUT_READ_TIMEOUT_SECONDS = 5 +F_SETPIPE_SIZE = 1031 # Linux-only constant +PIPE_SIZE_KB = 1024 # 1MB def revert_changes_for_frid(render_context): @@ -101,6 +104,10 @@ def execute_script( # noqa: C901 start_new_session=(sys.platform != "win32"), ) + if sys.platform == "linux": + # Set the pipe size to 1MB to avoid buffer overflows + fcntl.fcntl(proc.stdout.fileno(), F_SETPIPE_SIZE, PIPE_SIZE_KB * 1024) # 1MB + try: while proc.poll() is None: if time.time() - start_time >= script_timeout: