Skip to content

Conversation

@cderv
Copy link
Collaborator

@cderv cderv commented Oct 25, 2024

Follow up on #11135 and #11187 as they surfaced a problem where Chromium processed where not closed after rendering.

The real issue is there

close: async () => {
await client.close();

where somehow await client.close() does not return and so browser.close() never happens. This was confirmed by debugging interactively in VSCODE on Windows.

This PR is not solving the issue which is tracked at #11196 - it is only improving current logic for 1.6 releases to make sure we do clean after ourselves in all cases, like we do with other processed.

So for that aim, this PR adds browser Deno process to the same cleanupHandler for processes for quarto exitWithCleanup() logic. This cleanupHandler has all processes started with execProcess() already, but we can't use execProcess() here as we want to start the process in background, do HTML printing, then close.

…exitWithCleanup logic

As of 2024-10 and chrome v130, there is a problem where Chrome client `close()` function won't return correctly, skipping the normal code part of closing a chromium process started. So processes were not killed. Now those browser processes are added to the same cleanup handler used by `execProcess()` logic so that in case of something going wrong, they are killed and closed at last resort when Quarto exists.
Copy link
Collaborator

@cscheid cscheid left a comment

Choose a reason for hiding this comment

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

LGTM!

@cderv cderv merged commit d905295 into main Oct 25, 2024
47 checks passed
@cderv cderv deleted the fix/chrome-cleaning branch October 25, 2024 18:50
@cderv cderv added this to the v1.6 milestone Oct 25, 2024
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.

3 participants