Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve #6678 (sleep in RemoteDockerImage retries) #6679

Conversation

seregamorph
Copy link

@seregamorph seregamorph commented Feb 28, 2023

Solves #6678
There is retry cycle in RemoteDockerImage.resolve in case if Docker repository responds 5xx code. This cycle has the limit on time execution, but once the situation can happen, the log is just fully of garbage messages of failed attempt to make an HTTP call. Also it makes the redundant load on a docker repo.
In our case it was a wrong configured Artifactory for Docker images, the authentication token was missing. In the log there were thousands of failure messages done while timeout did not happen.

The proposal is pretty simple: add the sleep between retries in this cycle - either constant or logarithmic.

@seregamorph seregamorph requested a review from a team as a code owner February 28, 2023 21:38
@seregamorph
Copy link
Author

Can somebody please check it, I believe it's worth attention? Also any feedback is appreciated regarding enhancing the approach.

@seregamorph
Copy link
Author

Kind reminder. Again stepped into this pitfall with wrong configuration: the build log is just full of messages (thousands repeated patterns):

Warning:  Retrying pull for image: artifactory.tools.devrtb.com/docker-virtual/testcontainers/ryuk:0.4.0 (111s remaining)
Error:  Error during callback
com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"Head \"[https://artifactory.tools.devrtb.com/v2/docker-virtual/testcontainers/ryuk/manifests/0.4.0\](https://artifactory.tools.devrtb.com/v2/docker-virtual/testcontainers/ryuk/manifests/0.4.0/)": unknown: Authentication is required"}
    at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute (DefaultInvocationBuilder.java:247)
    at org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.lambda$executeAndStream$1 (DefaultInvocationBuilder.java:269)
    at java.lang.Thread.run (Thread.java:833)

@eddumelendez
Copy link
Member

Hi @seregamorph, sorry for the delay and thanks for submitting the PR. I'm bringing the topic to the team, so we can discuss about it. I'll be back to you as soon as have news.

@eddumelendez
Copy link
Member

Thanks for the PR, @seregamorph. This has been fixed in #8453 in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants