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

Asyncio error Task was destroyed but it is pending! #15

Open
clemlesne opened this issue Aug 23, 2024 · 2 comments
Open

Asyncio error Task was destroyed but it is pending! #15

clemlesne opened this issue Aug 23, 2024 · 2 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@clemlesne
Copy link
Owner

clemlesne commented Aug 23, 2024

Once each minute (5 workers), the error logs spawn:

Impact:

Seems none. Need to investigate.

Short logs:

ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-86588' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>

Related:

Full logs:

ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-86588' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-86623' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-86711' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-86727' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-86739' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-86801' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-86845' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-86874' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-86880' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-86945' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-87002' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-87017' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-87024' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-87096' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-87126' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-87182' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-87197' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-87206' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-87254' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-87356' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending name='Task-87365' coro=<Page._on_route() running at playwright/_impl/_page.py:282> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[AsyncIOEventEmitter._emit_run.<locals>.callback() at pyee/asyncio.py:69]>
@clemlesne clemlesne added the help wanted Extra attention is needed label Aug 23, 2024
@d-balaskas
Copy link

We faced the same error as well this week. Do you have any clue why this happens?

@clemlesne
Copy link
Owner Author

It is a warning from asyncio indicating that an asynchronous task has been terminated.

This seems to occur when the page or browser is closed while a load is still in progress (background calls, Ajax, API requests, deferred loading, etc.).

Since the application filters each network call for ads and network monitoring using an asynchronous method, these tasks can be abruptly terminated.

I don’t want to implement a large try/except block for this error because it could originate from other parts of the code, which would increase the complexity of debugging and hinder understanding of the issues.

If you have any suggestions, feel free to share!

@clemlesne clemlesne self-assigned this Sep 30, 2024
@clemlesne clemlesne added the bug Something isn't working label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants