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

Add timeout to warm gittar cache step #362

Merged
merged 16 commits into from
Feb 14, 2023
Merged

Conversation

ymekuria
Copy link
Collaborator

@ymekuria ymekuria commented Feb 10, 2023

Closes #314

Background

Sometimes the installation or upgrade of the zkapp-cli hangs during the warm cache for project template step in the postinstall.js file when a network request is made by gittar to fetch the zkapp-cli templates and examples from github here.

Approach

This PR adds a timeout to the fetch gittar operation. If the fetch operation does not resolve before the the timeout, the warm cache for project template step is skipped, and the installation continues. See this discussion for more details.

Next steps

A log was added to show which NPM packages were added to the cache in the warm NPM cache for project template deps step. A log was also added before the gittar fetch operation in the warm cache for project template step. We can use these logs to gain better visibility into hanging operations in the future and adjust the approach to addressing them accordingly.

src/postinstall.js Outdated Show resolved Hide resolved
@jasongitmail
Copy link
Contributor

Important for an eng reviewer to actually pull this branch to test it please

Copy link

@nicc nicc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Tested locally by dropping the timeout to 1ms and installing from my branch.
fyi to see the relevant logs I had to npm install with --verbose --foreground-scripts

@ymekuria
Copy link
Collaborator Author

ymekuria commented Feb 13, 2023

fyi to see the relevant logs I had to npm install with --verbose --foreground-scripts

Interesting @nicc. Were you able to see other logs from the postinstall.js file without the --verbose --foreground-scripts flag?

@ymekuria ymekuria merged commit 003f000 into main Feb 14, 2023
@ymekuria ymekuria deleted the feature/warm-cache-timeout branch March 13, 2023 23:07
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.

Time out when gittar cache warming hangs
3 participants