Skip to content

fix: fix BrowserPool and PlaywrightBrowserPlugin closure#932

Merged
vdusek merged 1 commit into
apify:masterfrom
Mantisus:playwright-successive-fix
Jan 29, 2025
Merged

fix: fix BrowserPool and PlaywrightBrowserPlugin closure#932
vdusek merged 1 commit into
apify:masterfrom
Mantisus:playwright-successive-fix

Conversation

@Mantisus

Copy link
Copy Markdown
Collaborator

Description

  • Fix the BrowserPool and PlaywrightBrowserPlugin closures. Without it, the application crashes when PlaywrightCrawler is run in sequence again.
@Mantisus

Mantisus commented Jan 24, 2025

Copy link
Copy Markdown
Collaborator Author
self._playwright_context_manager = async_playwright()

in PlaywrightBrowserPlugin.__aexit__ is needed because Playwright sets a flag that the manager has been closed - https://github.com/microsoft/playwright-python/blob/main/playwright/async_api/_context_manager.py#L56

@janbuchar janbuchar requested review from Pijukatel and vdusek January 24, 2025 20:09

@vdusek vdusek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks @Mantisus

@vdusek vdusek merged commit 997543d into apify:master Jan 29, 2025
@vdusek vdusek added bug Something isn't working. t-tooling Issues with this label are in the ownership of the tooling team. labels Jan 29, 2025
@vdusek vdusek added this to the 107th sprint - Tooling team milestone Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. t-tooling Issues with this label are in the ownership of the tooling team.

3 participants