Skip to content

Keep macOS proxy tunnels blocking after accept - #1320

Merged
JacobStephens2 merged 1 commit into
mainfrom
fix-macos-proxy-nonblocking
Oct 25, 2026
Merged

JacobStephens2 merged 1 commit into
mainfrom
fix-macos-proxy-nonblocking

Conversation

@JacobStephens2

Copy link
Copy Markdown
Owner

main's push CI on #1316's merge failed on macOS in proxy::tests::an_allowed_host_is_reached_through_the_proxy: the provider read EOF instead of request.

On macOS, as on other BSDs, a socket from accept() inherits the listener's O_NONBLOCK. Linux doesn't do this. The Trial proxy's listener is non-blocking so it can watch for shutdown, so on macOS every tunnel's client socket was non-blocking too. If the client wasn't sending at the moment the relay read, io::copy got WouldBlock, gave up, and half-closed the upstream. The test passed whenever the client won that race. A real macOS Trial would lose its tunnel at the first idle moment.

  • serve makes each accepted stream blocking before handing it off.
  • The tunnel test waits 200 ms before the client sends, as an idle tunnel does, so this fails every time on macOS instead of now and then.

Part of #1315.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LSAzXiA6BD9neiPgVQRMKD

macOS accepted sockets inherit the listener's O_NONBLOCK, so the relay's
first read with nothing waiting failed with WouldBlock and half-closed the
upstream. The tunnel test now pauses before the client sends, as an idle
tunnel does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LSAzXiA6BD9neiPgVQRMKD
@JacobStephens2 JacobStephens2 added the test:macos On a PR into main: run the full 4-shard macOS suite instead of the one-job macOS gate (#893) label Oct 25, 2026
@JacobStephens2
JacobStephens2 merged commit 6a2b684 into main Oct 25, 2026
21 of 28 checks passed
@JacobStephens2
JacobStephens2 deleted the fix-macos-proxy-nonblocking branch October 25, 2026 13:27
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:macos On a PR into main: run the full 4-shard macOS suite instead of the one-job macOS gate (#893)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant