Skip to content

Increase the probability for requests to Docker daemon to be executed consequently#1491

Closed
tejksat wants to merge 1 commit intodocker-java:masterfrom
tejksat:alexander.koshevoy/increaseProbabilityForRequestsToBeExecutedConsecutively
Closed

Increase the probability for requests to Docker daemon to be executed consequently#1491
tejksat wants to merge 1 commit intodocker-java:masterfrom
tejksat:alexander.koshevoy/increaseProbabilityForRequestsToBeExecutedConsecutively

Conversation

@tejksat
Copy link
Copy Markdown
Contributor

@tejksat tejksat commented Nov 12, 2020

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.

@tejksat tejksat force-pushed the alexander.koshevoy/increaseProbabilityForRequestsToBeExecutedConsecutively branch from 93ba44d to 71d7d43 Compare November 13, 2020 08:54
@tejksat
Copy link
Copy Markdown
Contributor Author

tejksat commented Nov 13, 2020

This attempt to fix issue #1492 turned out to be unreliable as the test keeps failing. I'm closing this PR.

I have created another PR with the workaround to fix the failing test: #1493.

@tejksat tejksat closed this Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant