Commit d85ea79
Fix "docker-java-stream" thread stuck at UnixDomainSocket.recv() (#1476)
* Fix "docker-java-stream" thread stuck at UnixDomainSocket.recv() (OkHttp transport) (#1475)
Prevent unnecessary recurring calls of `recv()` on UNIX socket, which sometimes results in blocking read and causes hanging of "docker-java-stream" thread.
* Fix potential stuck at UnixDomainSocket.read() (HttpClient transport) (#1475)
Prevent unnecessary recurring calls of `read()` on UNIX socket, which may result in blocking read and cause hanging of "docker-java-stream" thread.
* Use data's length value instead of calculating length once again
* Let UnixSocketInputStream.read(..) return -1 when the socket is disconnected or EOF is reached
* Move isConnected() check to the beginning of read(..) method
* Make UnixSocketInputStream.read() return -1 if EOF has been reached
Co-authored-by: Alexander Koshevoy <Alexander.Koshevoy@jetbrains.com>
Co-authored-by: Sergei Egorov <bsideup@gmail.com>1 parent 0d08a33 commit d85ea79
File tree
2 files changed
+27
-35
lines changed- docker-java-transport-httpclient5/src/main/java/com/github/dockerjava/httpclient5
- docker-java-transport-okhttp/src/main/java/com/github/dockerjava/okhttp
2 files changed
+27
-35
lines changedLines changed: 9 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
232 | 235 | | |
233 | 236 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | 237 | | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 238 | + | |
| 239 | + | |
254 | 240 | | |
255 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
256 | 245 | | |
257 | 246 | | |
258 | 247 | | |
| |||
268 | 257 | | |
269 | 258 | | |
270 | 259 | | |
271 | | - | |
| 260 | + | |
272 | 261 | | |
273 | 262 | | |
274 | 263 | | |
| |||
Lines changed: 18 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
233 | 236 | | |
234 | 237 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | 238 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
249 | 245 | | |
250 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
269 | 272 | | |
270 | 273 | | |
271 | 274 | | |
| |||
0 commit comments