Skip to content

Commit a200bf0

Browse files
author
Your Name
committed
Increasing pipe buffer size for non win32 machines
1 parent c28e57c commit a200bf0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

render_machine/render_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import threading
77
import time
88
from typing import Optional
9+
import fcntl
910

1011
import file_utils
1112
import git_utils
@@ -18,6 +19,7 @@
1819
POLL_INTERVAL_SECONDS = 0.2
1920
SIGTERM_GRACE_PERIOD_SECONDS = 0.2
2021
STDOUT_READ_TIMEOUT_SECONDS = 5
22+
F_SETPIPE_SZ = 1031 # Linux-only constant
2123

2224

2325
def revert_changes_for_frid(render_context):
@@ -101,6 +103,10 @@ def execute_script( # noqa: C901
101103
start_new_session=(sys.platform != "win32"),
102104
)
103105

106+
if sys.platform != "win32":
107+
# Set the pipe size to 1MB to avoid buffer overflows
108+
fcntl.fcntl(proc.stdout.fileno(), F_SETPIPE_SZ, 1024 * 1024) # 1MB
109+
104110
try:
105111
while proc.poll() is None:
106112
if time.time() - start_time >= script_timeout:

0 commit comments

Comments
 (0)