Skip to content
Unverified Commit e7e2419f authored by ysaito1001's avatar ysaito1001 Committed by GitHub
Browse files

Make `publisher` yank one crate at a time (#3324)

## Motivation and Context
`P109001503`

## Description
When `publisher` yanks crates, it blasts `crates.io` in parallel with
all the yank requests, and then awaits their results.

To avoid throttling errors, this PR instead yanks one crate at a time,
with a configurable time delay in between via a `--delay-millis` command
line argument. Further, a call to yank is now wrapped with
`run_with_retry` to detect throttle errors, wait a long period of time
after, and try again.

Essentially, the structure of the `yank` module is now similar to that
of the `publish` module such as use of `run_with_retry` and the presence
of a CLI argument `delay-millis`.

## Testing
On top of changes in the PR, manually modified the following for loop in
`yank_release.rs` locally
```
for (crate_name, crate_version) in crates {
```
to
```
for (crate_name, crate_version) in [("aws-sigv4", "0.55.0"); 50] { // aws-sigv4@0.55.0 has already been yanked in the past so it's safe to yank repeatedly
```
and observed the behavior of `publisher yank-release --delay-millis
2000` that it
- waits 2 seconds beteen yanks
- yanks in a serial manner

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent 24029ab2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment