Jersey and HttpClient5 implementations do not guarantees consecutive requests execution to Docker daemon · Issue #1492 · docker-java/docker-java · GitHub
Several get(...) and post(...) methods of com.github.dockerjava.core.DefaultInvocationBuilder class (where com.github.dockerjava.api.async.ResultCallback argument is passed) call executeAndStream(...) method. This method starts the separate thread which actually performs HTTP request. This method does not wait until the thread is started. This leads to the race condition where several consequent requests could be mixed up in the timeline.
F.e. in com.github.dockerjava.cmd.AttachContainerCmdIT.attachContainerWithTTY() test there are two commands that is performed consequently: "attach to container" and "start container". Sometimes HTTP requests are performed in the reverse order (start and then attach). This results in the lost data from stdout and stderr streams of the container process and leads to the test failure.
Activity
Workaround the problem with attachContainerWithTTY test failure (dock…
Preserve the order of requests to Docker daemon using DefaultInvocati…