Wait for request.abort to finish before calling is.close();
@@ -30,6 +30,8 @@ import io.fabric8.maven.docker.access.DockerAccessException;
import io.fabric8.maven.docker.access.UrlBuilder;
import io.fabric8.maven.docker.access.util.RequestUtil;
import io.fabric8.maven.docker.util.TimestampFactory;
+import io.fabric8.maven.docker.wait.WaitUtil;
+
import org.apache.commons.codec.binary.Hex;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
@@ -190,8 +192,15 @@ public class LogRequestor extends Thread implements LogGetHandle {
}
}
} finally {
- if ((is != null) && (is.available() > 0)) {
+ // When finish() returns, request == null
+ while (request != null) {
+ WaitUtil.sleep(500);
+ }
+
+ if ((is != null)) {
+ System.out.println("*** Calling is.close...");
is.close();
+ System.out.println("*** Calling is.close: done.");
}
}
}
@@ -215,7 +224,9 @@ public class LogRequestor extends Thread implements LogGetHandle {
@Override
public void finish() {
if (request != null) {
+ System.out.println("*** Calling request.abort...");
request.abort();
+ System.out.println("*** Calling request.abort: done.");
request = null;
}
}
