Repository navigation
Delegate socket options and half-close in UnixSocket - #527
Merged
Merged
Conversation
UnixSocket wraps an AFUNIXSocket, but the inherited java.net.Socket methods operated on the wrapper's own SocketImpl, which never gets connected: - setSoTimeout() was a no-op, so OkHttp's readTimeout never applied - shutdownOutput() failed with "SocketException: Not connected", e.g. when OkHttp closes the request body of a hijacked attach/exec stream Delegate SO_TIMEOUT (remembering a value set before connect), half-close and the related state queries to the actual socket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gesellix
added a commit
to gesellix/docker-client
that referenced
this pull request
Dec 3, 2026
Named pipe fixes for WCOW (docker-client/docker-filesocket#526) and UnixSocket timeout/half-close delegation (docker-client/docker-filesocket#527). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gesellix
added a commit
to docker-client/docker-remote-api-client
that referenced
this pull request
Dec 3, 2026
Named pipe fixes for WCOW (docker-client/docker-filesocket#526) and UnixSocket timeout/half-close delegation (docker-client/docker-filesocket#527). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gesellix
added a commit
to docker-client/docker-remote-api-client
that referenced
this pull request
Dec 3, 2026
Named pipe fixes for WCOW (docker-client/docker-filesocket#526) and UnixSocket timeout/half-close delegation (docker-client/docker-filesocket#527). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gesellix
added a commit
to gesellix/docker-client
that referenced
this pull request
Dec 3, 2026
Named pipe fixes for WCOW (docker-client/docker-filesocket#526) and UnixSocket timeout/half-close delegation (docker-client/docker-filesocket#527). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UnixSocketwraps junixsocket'sAFUNIXSocket, but only forwarded connect, the streams,bind,isConnected/isClosedandclose. All other inheritedjava.net.Socketmethods operated on the wrapper's own socket, which never gets connected:setSoTimeout()had no effect, so OkHttp's read timeout never applied to Unix sockets (Linux/macOS).shutdownOutput()failed withSocketException: Not connected. OkHttp calls it when closing the request body of a hijacked attach/exec stream. That's what failsattach (interactive)in Fix WCOW interactive and named pipe integration tests gesellix/docker-client#1200 on Ubuntu.NamedPipeSockethad the same class of bug, fixed in #526.Change
setSoTimeout/getSoTimeout(a value set beforeconnect()is remembered and applied),shutdownInput/shutdownOutput,isInputShutdown/isOutputShutdownandisBoundto the actual socket.connect()keeps the previous default (read timeout = connect timeout).Tests
UnixSocketTestuses an in-process AF_UNIX server (no Docker needed; runs on Linux, macOS and Windows 10+): half-close delivers EOF to the peer while the response can still be read, read timeout, soTimeout set before connect. The half-close and read-timeout tests fail against the previous implementation.🤖 Generated with Claude Code