Files
floci/docs/configuration
Hector Ventura ddc47a465d fix(core): make Docker read timeouts real on a Unix-socket host, except for long-lived streams (#5294)
* fix(core): make Docker read timeouts real on a Unix-socket host, except for long-lived streams

docker-java's UnixSocket reads through a blocking channel stream that
ignores SO_TIMEOUT, so on the default unix:// Docker host no call ever
timed out: a 2-second response timeout let a container wait run 153
seconds, and a hung daemon blocked its caller forever. It is also why
httpclient5's stale-connection check, a read with a 1 ms timeout, cannot be
enabled there.

FlociDockerHttpClient now connects to a unix:// host through
UnixDomainSocket, which keeps the channel non-blocking and waits on a
selector, so a read with a timeout fails with SocketTimeoutException. Making
the timeout real would cut off streams that are silent while healthy, so
requests that hold a stream open (container wait, exec and attach output,
followed logs, streamed stats, events, image pulls and builds) get no
response timeout on any host, which also keeps a TCP host's container wait
from dying at five minutes. Every other call keeps the 5-minute timeout.

* fix(core): keep the Unix socket's failures IOExceptions on close and interrupt

Closing the socket while another thread waited in a read or write could
end that wait with the selector's unchecked ClosedSelectorException,
since close() may shut the selector between select() and
selectedKeys(); callers expecting an IOException did not handle it. It
is now a SocketException. A thread reading a silent stream with no
timeout spun once interrupted, because select() returns at once while
the interrupt flag is set; it now closes the socket and throws
ClosedByInterruptException, as the blocking channel it replaced did.

The tests wait with a timed get that expects a TimeoutException rather
than a fixed sleep, so an early return fails at once, and cover a close
during a blocked read and an interrupted read.
2026-10-08 07:27:04 -04:00
..