Implement retrying of python package install in case of choco api failure. - #16917
Implement retrying of python package install in case of choco api failure.#16917rodiazet wants to merge 1 commit into
Conversation
419a82b to
e2944a4
Compare
There was a problem hiding this comment.
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.
| # Timeout) so retry a few times before giving up. | ||
| command: | | ||
| for i in $(seq 1 5); do | ||
| choco install python312 --pre --force && exit 0 |
There was a problem hiding this comment.
Why?
| choco install python312 --pre --force && exit 0 | |
| choco install python312 --pre --force |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Because it will fail the whole step on the first attempt which fails.
|
I have not seen problems with windows builds. Seems like an overkill at the moment. |
|
OK, I get your point. |

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
Sonnet 5.