Skip to content

Commit 76053ab

Browse files
pskowronekKostyaSha
authored andcommitted
Ignore exception while closing stream to let awaitCompletion finish before time-out (docker-java#1149)
* Ignore exception while closing stream to let awaitCompletion finish before time-out * Ensure completed#countDown is called even if exception is thrown while closing stream
1 parent 3d29559 commit 76053ab

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/com/github/dockerjava/core/async/ResultCallbackTemplate.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,13 @@ public void onComplete() {
7474
public void close() throws IOException {
7575
if (!closed) {
7676
closed = true;
77-
if (stream != null) {
78-
stream.close();
77+
try {
78+
if (stream != null) {
79+
stream.close();
80+
}
81+
} finally {
82+
completed.countDown();
7983
}
80-
completed.countDown();
8184
}
8285
}
8386

0 commit comments

Comments
 (0)