-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[BUG] Lock not released in case of ECONNRESET when installing #5110
Comments
- release lock if an exception happens during install - retry downloading to support intermittent network Fixes microsoft#5110
@alexdima awesome investigation! I've adopted your snippet code into Playwright to run download re-tries. |
@alexdima so the fix has landed and is available at the |
Context:
Background
We use caching of
node_modules
foders to speed up our CI build times and we executeyarn
withPLAYWRIGHT_SKIP_BROWSER_DOWNLOAD
, so oftentimesnode_modules
are restored but the playwright downloads are not restored anyways, so we then run the install script by ourselves.So on our build machines we invoke
node node_modules/playwright/install.js
and we see every now and again that builds fail due toECONNRESET
errors when trying to install playwright. e.g. https://github.com/microsoft/vscode/runs/1747455678#step:12:130That is to be expected since internet might always be flaky, and the normal path forward is to just retry downloading.
Problem
We've added some code to retry installing on our side e.g.
So basically we invoke
installBrowsersWithProgressBar
again and again until it stops throwingECONNRESET
but at most 10 times.The problem is that we now get builds failing with
Lock file is already being held
errors e.g. https://github.com/microsoft/vscode/runs/1748968312#step:10:264From a quick look there is some locking done in that function and the locks are not released in the error path. IMHO the problem might be in installBrowsersWithProgressBar which perhaps should wrap
await releaseLock();
in afinally
block.If you have a better way to install playwright which is resilient to intermittent network errors, I would be happy to try that out instead.
The text was updated successfully, but these errors were encountered: