Closed kachkaev closed 2 years ago
Have you tried to reach out to Azure devops support, it does not sound right that you get Service Unavailable
errors?
If this is some kind of rate limiting that requires honoring retry-after
header it should be implemented in yarn itself, there are already feature request you can comment on.
IMHO retry could be done on the task level, i.e. the task will invoke yarn install
with all flags, check the exit code and retry N times until it's zero. This can be entirely done in the scope of the task logic.
Service Unavailable is not necessarily Azure's fault – npmjs.com can be buggy due to current load etc.
+1, we are seeing plenty of 503 errors too. It would be nice to have this retry logic
Ideally Microsoft/Yarn/npm would fix the registries, so that things do not time out, but if that doesn't happen, someone else needs to implement solutions.
Second best would be if Yarn could have functionality for that, but it does not seem to happen very quickly, even though there is a two year old issue: https://github.com/yarnpkg/yarn/issues/5547
If none of those are happening, it would be wonderful to have some logic in this task itself. Would at least get rid of the issues we are seeing in CI, and prevent randomly failing builds to some extent 🤔
Azure Pipelines now supports automatic retries: https://docs.microsoft.com/en-us/azure/devops/release-notes/2021/sprint-195-update#automatic-retries-for-a-task
Are you reporting a bug or a feature request ?
Description
It'd be cool to see more resilience in the
yarn install
task. About one in our 20-50 pipeline runs fails because of some random network or registry issue while fetching packages. Here is an example:Expected behavior
I'd expect some extra failover from the task in such case, e.g. via an option to have extra attempts. Meanwhile, here's our workaround:
↑ All tasks are the same except that the first two have Control options → ☑️ Continue on error
It'd be cool if we could just use a new option for the number of retries.
System information
VSTS or TFS:
Agent:
OS:
Yarn version: v1.21
Node version: v12.16.1