docker-client icon indicating copy to clipboard operation
docker-client copied to clipboard

[resteasy] Reading events without `until` parameter blocks indefinitely on close

Open dmandalidis opened this issue 4 years ago • 2 comments

BUG REPORT:

Description

Closing the event reader blocks forever

How to reproduce

try (DockerClient client = new ResteasyDockerClientBuilder().fromEnv().build()) {
      try (EventStream events = client.events()) {}
}

Software:

  • docker version: any
  • docker-client version: >=4.0.0

dmandalidis avatar Aug 15 '21 14:08 dmandalidis

The issue here is that when you consume events in a unbounded manner (i.e. no dates), the ChunkedInputStream will never receive the expected CRLF in order to let the client code to close the stream. Given that a no-timeout http client is constructed from the docker-client side, the close() method blocks indefinitely waiting for a CRLF before closing the stream

dmandalidis avatar Aug 16 '21 13:08 dmandalidis

Root cause : https://issues.redhat.com/browse/RESTEASY-1478

dmandalidis avatar Aug 16 '21 14:08 dmandalidis