-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: retry on timeout connections to external registry #917
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small comment, thanks for the PR :)
try: | ||
image_exists = docker.container_image_exists(tag) | ||
except Exception: | ||
image_exists = False | ||
if image_exists: | ||
logger.warning( | ||
f"Build of container image {tag} failed, probably because it was done by a concurrent build", | ||
exc_info=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try: | |
image_exists = docker.container_image_exists(tag) | |
except Exception: | |
image_exists = False | |
if image_exists: | |
logger.warning( | |
f"Build of container image {tag} failed, probably because it was done by a concurrent build", | |
exc_info=True, | |
try: | |
if docker.container_image_exists(tag): | |
logger.warning( | |
f"Build of container image {tag} failed, probably because it was done by a concurrent build", | |
exc_info=True, | |
) | |
return | |
except Exception: | |
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it more explicit that way. Feel free to ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to wrap the try except
on the minimal number of lines, to mark explicitly what could potentially raise, and to avoid to mask unexpected Exceptions (even more when using a blanket except Exception
).
I'm curious though, what do you find more explicit in your suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point. What I found more explicit is to not set image_exists = False
cause it's never used afterwards, and to explicitely set the except Exception: pass
to clearly indicate that we bypass all exceptions.
64b6c36
to
5fdf0a2
Compare
Signed-off-by: SdgJlbl <sarah.diot-girard@owkin.com>
/e2e |
End to end tests: ✔️ SUCCESS Crushed it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks :)
fixes fl-1569