Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid ESOCKETTIMEDOUT while installing a large package on a slow disk #8363

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anhvut
Copy link

@anhvut anhvut commented Sep 30, 2020

Avoid message There appears to be trouble with your network connection. Retrying... and ends up with ESOCKETTIMEDOUT during install a large package. Fixes #8242 and many potential duplicates.

Summary

During install from a remote registry, the tgz package download is streamed to uncompress files at same time. When uncompress time is higher than the socket timeout, the network connection is lost to download next parts of tgz file.

This issue is likely to occur:

  • on Windows (slow) NTFS filesystem
  • when an antivirus is scanning in real-time
  • when a large package is to be installed
  • and/or the package contains lots of small files, causing a significant overhead

This issue can be worked around by increasing the network-timeout option. However, the filesystem overhead is not really linked to network socket. Therefore a more appropriate solution is preferred.

In order to fix the timeout error, the install process is split in two parts:

  • the tgz package is downloaded first to yarn cache.
  • then the downloaded file is streamed in read access to uncompress, compute checksum integrity.

This is just a technical fix, impact is very isolated, therefore there is no need to update CHANGELOG.md

Test plan

No regression on automated tests.

Yarn install failed on my machine with package @material-ui/icons 4.9.1 (16645 files) and default timeout 30s.
After the fix, yarn successfully install this package with network-timeout 5s only.

@fbartho
Copy link

fbartho commented Apr 25, 2023

I'm running into this issue as well. Is there a way to revive this PR? Thanks!

@nchal
Copy link

nchal commented Jul 4, 2023

same issue here, this workaround is working well : yarn config set network-timeout 300000 but as @anhvut said, not appropriate here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Yarn fails with ESOCKETTIMEDOUT while installing a large package on a slow disk
3 participants