You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Playwright is only supported in a single thread and does not allow any thread-sharing operations. Is this maybe the reason why this comes up?
Would it be possible to provide a minimal reproduction which demonstrates this issue?
Most likely unrelated: I see that inside your loop you call browser.new_page() but never close the page. You need to call page.close() at the end of your loop to not have any memory leak during your for loop. (Yes browser.close() will also clean up all the pages, and contexts, but if your for loop contains 1000 items, its likely to create a lot of unnecessary memory.)
It was added as part of #1430. Would have to dig deeper to understand the reason behind this change.
Closing as part of the triage process since it seemed stale. Please create a new issue with a detailed reproducible or feature request if you still face issues.
Context:
Describe the bug
I'm running a gRPC server using a loop, and then using playwright to fetch some URL: https://github.com/hwchase17/langchain/blob/e3b7a20454cea592fc6d0a0d91c36206e8ad6790/langchain/document_loaders/url_playwright.py#L62
when the context is exiting, this error is thrown
RuntimeError: Set changed size during iteration
this is happening due to an old upstream bug in cpython python/cpython#80788
we need to refactor the context manager to close itself differently
playwright-python/playwright/sync_api/_context_manager.py
Line 106 in b9b8fed
TBH, I don't know why we even do that :O
The text was updated successfully, but these errors were encountered: