Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: cancelling a script does not kill chromium processes #4198

Open
whollacsek opened this issue Aug 6, 2024 · 2 comments
Open

bug: cancelling a script does not kill chromium processes #4198

whollacsek opened this issue Aug 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@whollacsek
Copy link

Describe the bug

In the script editor if we click on the test button on the right panel then click on cancel button while a puppeteer instance is running the associated chromium process is not kill properly which lead to maximum CPU usage.

To reproduce

  1. Create new script with minimal puppeteer usage:
import 'puppeteer-core'
import puppeteer from 'puppeteer-extra'

export async function main() {
  const browser = await puppeteer.launch(
    { executablePath: '/usr/bin/chromium', headless: true, args: ['--no-sandbox'] }
  )

  const page = await browser.newPage()
  await page.goto('https://www.google.com')
  // ... do more work here
  await browser.close()
}
  1. Click on test on the right panel
  2. Click on cancel on the right panel before the script is done
  3. CPU shoots up and chromium process is not killed

Expected behavior

No chromium process should be left

Screenshots

No response

Browser information

No response

Application version

CE v1.375.0-1-gfbcac1e0a

Additional Context

No response

@whollacsek whollacsek added the bug Something isn't working label Aug 6, 2024
@rubenfiszel
Copy link
Contributor

Try this:

    args: ['--single-process', '--no-zygote', '--no-sandbox']

from https://thedavidbarton.github.io/blog/chromium-instances-remain-active-in-the-background-after-browser-disconnect/

@whollacsek
Copy link
Author

It doesn't seem to work with those args, however I just tried adding MAX_WAIT_FOR_SIGINT=1 to the worker container and the child process is killed (#3094 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants