Skip to content

Commit

Permalink
slightly more assertive puppeteer shutdown instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
phfaist committed Feb 13, 2025
1 parent 6a0d4ce commit 85369b6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion _zoodb_citations_cache/cache_compiled_citations.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion _zoodb_citations_cache/cache_downloaded_info.json

Large diffs are not rendered by default.

33 changes: 22 additions & 11 deletions jscomponents/codegraph/headlessGraphExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,30 @@ export class CodeGraphSvgExporter
await this.browser_code_server.close();
}

// Close page.
if (this.page != null) {
debug(`Shutting down headless puppeteer browser page...`);
await this.page.close();
this.page = null;
}

// Close browser.
// .close() methods appear unreliable.
// cf. https://github.com/puppeteer/puppeteer/issues/7922
if (this.browser != null) {
debug(`Shutting down headless puppeteer browser...`);
await this.browser.close();
this.browser = null;
debug(`Bye bye puppeteer browser page...`);
const childProcess = this.browser.process()
if (childProcess) {
childProcess.kill(9)
}
}

// // Close page.
// if (this.page != null) {
// debug(`Shutting down headless puppeteer browser page...`);
// await this.page.close();
// this.page = null;
// }

// // Close browser.
// if (this.browser != null) {
// debug(`Shutting down headless puppeteer browser...`);
// await this.browser.close();
// this.browser = null;
// }

debug(`Internal headless puppeteer browser instance completely shut down.`);
}

Expand Down

0 comments on commit 85369b6

Please sign in to comment.