Skip to content

[Bug] cdpSession.send: Target page, context or browser has been closed #858

@alucarded

Description

@alucarded

Describe the bug

page.goto: Timeout 10000ms exceeded.
Call log:
  - navigating to "[SOME_URL]", waiting until "commit"

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

cdpSession.send: Target page, context or browser has been closed
    at Object.send ([project_dir]/node_modules/playwright-extra/dist/index.cjs.js:194:46)

I was doing load test of a web server using playwright with playwright-extra to render URLs (once per request).
Load test was done with multiple threads hitting an endpoint.
Every call to an endpoint spawns a separate chromium instance with playwright.
This only started to happen when increasing number of threads to the point where rendering a page with playwright was timing out.

This is critical issue when using playwright in a web service since it crashes it.

Code Snippet

I will create a pull request that fixes the issue.

Versions

System:
OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900K
Memory: 30.08 GB / 31.23 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 18.17.1 - /usr/bin/node
npm: 10.2.4 - /usr/bin/npm
npmPackages:
playwright: ^1.39.0 => 1.40.0
playwright-extra: ^4.3.6 => 4.3.6
puppeteer-extra-plugin-stealth: ^2.11.2 => 2.11.2

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions