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

RuntimeError: Event loop is closed #111

Open
alan-mi opened this issue Dec 5, 2024 · 0 comments
Open

RuntimeError: Event loop is closed #111

alan-mi opened this issue Dec 5, 2024 · 0 comments

Comments

@alan-mi
Copy link

alan-mi commented Dec 5, 2024

When I run pytest, it reports the following error, but it can run successfully when using aiomysql directly.

2024-12-05 18:08:19,869 INFO sqlalchemy.pool.impl.AsyncAdaptedQueuePool Disconnection detected on checkout, invalidating all pooled connections prior to current timestamp (reason: InvalidatePoolError())
2024-12-05 18:08:19,869 INFO sqlalchemy.pool.impl.AsyncAdaptedQueuePool Invalidate connection <AdaptedConnection <asyncmy.connection.Connection object at 0x0000018F41CBF010>> (reason: InvalidatePoolError:())
2024-12-05 18:08:19,869 ERROR sqlalchemy.pool.impl.AsyncAdaptedQueuePool Exception terminating connection <AdaptedConnection <asyncmy.connection.Connection object at 0x0000018F41CBF010>>
Traceback (most recent call last):
  File "D:\code\LX10.04_llm_plugins\venv\lib\site-packages\sqlalchemy\pool\base.py", line 1310, in _checkout
    raise exc.InvalidatePoolError()
sqlalchemy.exc.InvalidatePoolError: ()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\code\LX10.04_llm_plugins\venv\lib\site-packages\sqlalchemy\pool\base.py", line 374, in _close_connection
    self._dialect.do_terminate(connection)
  File "D:\code\LX10.04_llm_plugins\venv\lib\site-packages\sqlalchemy\dialects\mysql\asyncmy.py", line 312, in do_terminate
    dbapi_connection.terminate()
  File "D:\code\LX10.04_llm_plugins\venv\lib\site-packages\sqlalchemy\dialects\mysql\asyncmy.py", line 226, in terminate
    self._connection.close()
  File "asyncmy\\connection.pyx", line 336, in asyncmy.connection.Connection.close
  File "D:\QAXDownload\software\python310\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\QAXDownload\software\python310\lib\asyncio\base_events.py", line 750, in call_soon
    self._check_closed()
  File "D:\QAXDownload\software\python310\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant