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.
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.runfor CRI client should be closed upon client closingquarto-cli/src/core/cri/cri.ts
Lines 121 to 125 in c96fe72
However, from interactive debugging, it happens
browser.close()is never called above asawait client.close()somehow does not return in a way the next command is ran.This whole logic is used in
withCriClient()like inquarto-cli/src/core/handlers/base.ts
Lines 180 to 190 in c96fe72
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.