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

feat: retry on timeout connections to external registry #917

Merged
merged 1 commit into from
Jun 10, 2024
Merged

Conversation

SdgJlbl
Copy link
Contributor

@SdgJlbl SdgJlbl commented May 31, 2024

fixes fl-1569

@SdgJlbl SdgJlbl requested a review from a team as a code owner May 31, 2024 09:44
Copy link

linear bot commented May 31, 2024

Copy link
Member

@ThibaultFy ThibaultFy left a 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 :)

Comment on lines +169 to 176
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,
Copy link
Member

@ThibaultFy ThibaultFy May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

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.

@SdgJlbl SdgJlbl force-pushed the feat/fl-1569 branch 2 times, most recently from 64b6c36 to 5fdf0a2 Compare June 7, 2024 13:53
@Substra Substra deleted a comment from Owlfred Jun 7, 2024
@Substra Substra deleted a comment from Owlfred Jun 10, 2024
Signed-off-by: SdgJlbl <sarah.diot-girard@owkin.com>
@SdgJlbl
Copy link
Contributor Author

SdgJlbl commented Jun 10, 2024

/e2e

@Owlfred
Copy link

Owlfred commented Jun 10, 2024

End to end tests: ✔️ SUCCESS

Crushed it!

Copy link
Member

@ThibaultFy ThibaultFy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :)

@SdgJlbl SdgJlbl merged commit 5ff25eb into main Jun 10, 2024
7 checks passed
@SdgJlbl SdgJlbl deleted the feat/fl-1569 branch June 10, 2024 12:57
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.

3 participants