Skip to content

Yarn does not retry package download on server side failure #7610

@zymzxq

Description

@zymzxq

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Yarn does not retry downloading artifacts when the registry returns 500 responses

If the current behavior is a bug, please provide the steps to reproduce.

  1. Creating a mock webserver using javascript or python or nginx
  2. Find any existing yarn project with a yarn.lock file. Change any of the package in the lock file to download from your mocked webserver
  3. Run yarn install
  4. The url to your webserver is requested only once.

What is the expected behavior?
From the previous 2 prs: 3686 and 6413, yarn should retry on server side errors. However, the later pr seems to have introduced a bug that stops this from happening. It moved the retry logic from tarball-fetcher.js into request-manager.js and put it inside if (!params.process) condition(line 422 in request-manager.js), which eventually stopped retry from happening because params.process is always not null(see tarball-fetcher.js line 273 in the 2nd pr). It seems to be an unexpected change according to the test case.

Please mention your node.js, yarn and operating system version.
Yarn: 1.17.3
Node: 12.7.0
OS: macos mojave

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed-in-modernThis issue has been fixed / implemented in Yarn 2+.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions