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.exceptions.CancelledError #266

Closed
JerryHuang-LE opened this issue Sep 5, 2023 · 2 comments
Closed

asyncio.exceptions.CancelledError #266

JerryHuang-LE opened this issue Sep 5, 2023 · 2 comments

Comments

@JerryHuang-LE
Copy link

I am using the Quart framework, and after bumping up the dependencies version (Quart-schema), we are getting some weird issues.
Not sure if it is related to Quart or not. Can someone give me some suggestions please? Thanks

 File "/app/.venv/lib/python3.11/site-packages/aiohttp/client.py", line 536, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/aiohttp/connector.py", line 1152, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
  File "/app/lere/model/personalisation/hot_leads/sticky_hot_leads.py", line 39, in get_hot_leads_offers
    hot_leads = await get_cache_for_hot_leads(user_id)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lere/logs/logger.py", line 262, in async_wrapper
    value = await logging_logic.execute_async()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lere/logs/logger.py", line 248, in execute_async
    self.result = await async_function(*self.args, **self.kwargs)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lere/model/personalisation/hot_leads/cache.py", line 22, in get_cache_for_hot_leads
    await asyncio.to_thread(
  File "/usr/local/lib/python3.11/asyncio/threads.py", line 25, in to_thread
    return await loop.run_in_executor(None, func_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
  File "/app/lere/model/personalisation/hot_leads/cache.py", line 22, in get_cache_for_hot_leads
    await asyncio.to_thread(
  File "/usr/local/lib/python3.11/asyncio/threads.py", line 25, in to_thread
    return await loop.run_in_executor(None, func_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

But sorry about that, i have no idea how to re-produce them as it happened randomly. Sometimes it could happen when the service keep running for 2 hours, sometimes it could get those errors in half hour. :-(

Environment:

  • Python version: 3.11.3
  • Quart version: 0.18.4
@pgjones
Copy link
Member

pgjones commented Sep 5, 2023

Most of the stack trace seems unrelated to Quart/Quart-Schema, are you sure nothing else changed?

@JerryHuang-LE
Copy link
Author

Most of the stack trace seems unrelated to Quart/Quart-Schema, are you sure nothing else changed?

Actually, when i bumped up the Quart-schema, some dependencies bumps up together (not sure if Quart-schema needs the newer version of these dependencies or not). I think the only way is reverting the dependencies one by one, and then test it one by one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants