Skip to content

browser processes for CRI feature is not closed after being used #11196

@cderv

Description

@cderv

While working on #11135 and #11187, I found a problem of chrome processes not being closed after Quarto ends. This specific cleaning problem should be fixed with #11195. However, the initial problem still remains.

Browser process started with Deno.run for CRI client should be closed upon client closing

const result = {
close: async () => {
await client.close();
browser.close();
},

However, from interactive debugging, it happens browser.close() is never called above as await client.close() somehow does not return in a way the next command is ran.

This whole logic is used in withCriClient() like in

const { elements, images } = await withCriClient(async (client) => {
await client.open(url);
const elements = await client.contents(selector);
const screenshots = await client.screenshots(
selector,
deviceScaleFactor,
);
return {
elements,
images: screenshots.map((x) => x.data),
};

And return() is correctly stepped in, but process started for client is not closed.

So this issue should be dealt with - however, this could be also done in a broader improvement work that could be needed anyway. Chrome Headless new mode is now the default, and old mode will be removed from chromium binary inside its own binary. So new mode should be used and some adaptation are done anyway.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingchromium

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions