Skip to content

Commit 45d6acf

Browse files
[serve] Shorten stderr-redirect comment
7 lines → 3 lines. Keeps the surprising bit (rename safety via fd-binds-to-inode). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f03cedc commit 45d6acf

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

python/ray/serve/_private/haproxy.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -711,13 +711,9 @@ async def _start_and_wait_for_haproxy(
711711

712712
logger.debug(f"Starting HAProxy with args: {args}")
713713

714-
# Redirect HAProxy stderr to a file via dup2 at fork instead of
715-
# piping it back to this process. Without a pipe, the 64KB kernel
716-
# buffer that previously deadlocked admin-socket threads doesn't
717-
# exist. We open the file with a temporary name (we don't know the
718-
# child pid yet) and rename it to include the pid after spawn.
719-
# Linux fds bind to inodes, not paths, so the rename doesn't
720-
# disturb the child's writes.
714+
# Redirect stderr to a file (no pipe → no 64KB buffer to deadlock
715+
# on). Open with a temp name pre-spawn, rename to the pid path
716+
# after; safe because fds bind to inodes, not paths.
721717
tmp_stderr_path = f"{self.cfg.socket_path}.stderr.starting.log"
722718
with open(tmp_stderr_path, "ab", buffering=0) as stderr_file:
723719
proc = await asyncio.create_subprocess_exec(

0 commit comments

Comments
 (0)