Skip to content

Commit

Permalink
#662 Retry any exceptions (not just DockerClientException) on image…
Browse files Browse the repository at this point in the history
… pull (#663)
  • Loading branch information
bsideup committed Apr 28, 2018
1 parent 2b48306 commit 67cde07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
## UNRELEASED

### Fixed
- Retry any exceptions (not just `DockerClientException`) on image pull ([\#662](https://github.com/testcontainers/testcontainers-java/issues/662))

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected final String resolve() {
profiler.start("Check local images");

int attempts = 0;
DockerClientException lastException = null;
Exception lastException = null;
while (true) {
// Does our cache already know the image?
if (AVAILABLE_IMAGE_NAME_CACHE.contains(imageName)) {
Expand Down Expand Up @@ -98,10 +98,10 @@ protected final String resolve() {
.pullImageCmd(imageName.getUnversionedPart())
.withTag(imageName.getVersionPart())
.exec(callback);
callback.awaitSuccess();
callback.awaitCompletion();
AVAILABLE_IMAGE_NAME_CACHE.add(imageName);
break;
} catch (DockerClientException e) {
} catch (Exception e) {
lastException = e;
}
}
Expand Down

0 comments on commit 67cde07

Please sign in to comment.