Skip to content

Fix socket forwarding hangs and shared I/O stalls - #933

Merged
realrajaryan merged 2 commits into
apple:mainfrom
realrajaryan:fix-socket-fwd-hang
Sep 23, 2026
Merged

realrajaryan merged 2 commits into
apple:mainfrom
realrajaryan:fix-socket-fwd-hang

Conversation

@realrajaryan

Copy link
Copy Markdown
Member

This PR addresses the SSH-agent forwarding hangs and terminal/exec stalls reported in apple/container#2247. The relay now registers both ends before forwarding starts and resumes blocked writes when the destination is ready, allowing other work on the shared I/O loop to continue. When connections close, buffered data is drained before EOF and stale events are discarded as file descriptors are reused. On the host, failed socket connections are closed individually so the listener keeps accepting new clients.

@realrajaryan
realrajaryan force-pushed the fix-socket-fwd-hang branch 4 times, most recently from f24636d to a6d9ab2 Compare September 18, 2026 19:04
@realrajaryan
realrajaryan requested a review from dkovba September 18, 2026 19:49
Comment thread vminitd/Sources/VminitdCore/IOPair.swift Outdated
Comment thread Sources/Containerization/UnixSocketRelay.swift
Comment thread Sources/Containerization/UnixSocketRelay.swift

@dkovba dkovba left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@realrajaryan
realrajaryan merged commit 8b8cd7e into apple:main Sep 23, 2026
7 checks passed
@realrajaryan
realrajaryan deleted the fix-socket-fwd-hang branch September 23, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants