Commit 0d08a33
authored
The problem is that using `awaitStarted()` on `attach`'s callback on a non-running container leads to the infinite wait for Jersey transport implementation.
This happens when `SelectiveLoggingFilter` is used in `DefaultInvocationBuilder` where it is created with `printEntity = true` parameter. In this case the implementation of `ClientResponseFilter.filter(...)` method in the base `LoggingFilter` class blocks at `responseContext.hasEntity()` until the data is available in the response. This happens because `hasEntity()` reads a single byte to check whether there is any data available in the stream. In the case of `attach` command this method blocks until there is data in stdout/stderr streams. Having data from the streams requires container running, which we cannot do safely without `awaitStarted()` because `attach` command is performed in a separate thread and we need to run `start` only _after_ `attach` request is executed not to loose the data from stdout/stderr streams.
1 parent ce5e9eb commit 0d08a33
File tree
2 files changed
+14
-3
lines changed- docker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs
- docker-java/src/test/java/com/github/dockerjava/cmd
2 files changed
+14
-3
lines changeddocker-java-transport-jersey/src/main/java/com/github/dockerjava/jaxrs/JerseyDockerHttpClient.java
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
| |||
164 | 169 | | |
165 | 170 | | |
166 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
167 | 175 | | |
168 | 176 | | |
169 | 177 | | |
| |||
213 | 221 | | |
214 | 222 | | |
215 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
216 | 227 | | |
217 | 228 | | |
218 | 229 | | |
| |||
0 commit comments