Skip to content

Implement retrying of python package install in case of choco api failure. - #16917

Open
rodiazet wants to merge 1 commit into
developfrom
fix-python312-choco-install
Open

Implement retrying of python package install in case of choco api failure.#16917
rodiazet wants to merge 1 commit into
developfrom
fix-python312-choco-install

Conversation

@rodiazet

@rodiazet rodiazet commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

Choco API fails from time to time when downloading a package. This PR implements simple retrying mechanism to avoid the need to restart manually.

AI Disclosure

  • No AI tools were used

Sonnet 5.

@rodiazet
rodiazet force-pushed the fix-python312-choco-install branch from 419a82b to e2944a4 Compare August 14, 2026 13:18

@cameel cameel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The main thing I have against this is that it's very verbose and does not even solve the problem completely (only if the interruption in service is very short). I really don't want a pattern like this to spread all over our config, which is already big and complicated.

Before doing this, please first check if Chocolatey has some flag that makes it retry. That would be preferable and the most concise.

If not, check if this image has the retry command.

Only if the above fail, I'd go with this, but then I'd omit all the superfluous bits to make it very concise. No extra comments, no extra messages. Just the loop, command, sleep.

I'm still not convinced that the problem is worth solving though. We have tons of stuff that times out from time to time.

Comment thread .circleci/config.yml
# Timeout) so retry a few times before giving up.
command: |
for i in $(seq 1 5); do
choco install python312 --pre --force && exit 0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why?

Suggested change
choco install python312 --pre --force && exit 0
choco install python312 --pre --force

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Actually, looking at it again now, it's correct. It exits with 0 here and exiting the loop is a failure so there it exits with 1.

Still, I find this flow unnecessarily hard to follow.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because it will fail the whole step on the first attempt which fails.

Comment thread .circleci/config.yml
@blishko

blishko commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

I have not seen problems with windows builds. Seems like an overkill at the moment.

@blishko

blishko commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

OK, I get your point.
But isn't this some recent thing? I have never had trouble with Windows builds here.

@rodiazet

Copy link
Copy Markdown
Contributor Author

Looks like it’s last week. If it gets better this week we can leave the PR, but if it’s going to be longer like that we should consider merging. This is Claude analysis of the last 30 days.
Screenshot 2026-08-17 at 10 39 39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants