Closed awanishraj closed 5 years ago
fixed and new version released , thanks
Hi Shawn, the issue is still present. getting = false
needs to be present at the end of if condition and not else
if (null === globalBrowser && !getting) {
//...
const version = await globalBrowser.version();
console.log(`Launch chrome: ${version}`);
getting = false; //inside if condition
return globalBrowser;
} else{
do {
await Promise.delay(50);
} while (!globalBrowser);
// getting = false; <- Not required here
return globalBrowser;
}
In
src/index.js
the _getBrowser routine gets stuck in an infinite loop when the browser element is closed and opened again by another lambda instanceAWS Lambda reuses execution context, so if invoked too soon again, it gets stuck in a loop.
In
src/index.js
The if condition always fails if
globalBrowser
is null and the value ofgetting
is true. On further inspection, the value ofgetting
is not being set tofalse
ever. Addinggetting = false
inside the if condition after the browser is successfully launched fixes the issue