🌐 AI搜索 & 代理 主页
Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

Conversation

@RazAnyVision
Copy link

@RazAnyVision RazAnyVision commented Mar 14, 2020

aio.Consul.close() uses aiohttp.ClientSession.close() which returns a coroutine that was never awaited. When this happens, RuntimeWarnings are raised on termination:

RuntimeWarning: coroutine 'ClientSession.close' was never awaited
self._session.close()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fee7d894340>
Unclosed connector
connections: []
connector: <aiohttp.connector.TCPConnector object at 0x7fee7d894310>

In this change the coroutine will be returned so it could be awaited and by that avoids these warnings.

@RazAnyVision RazAnyVision changed the title aio.Consul.close() uses aiohttp.ClientSession.close() which returns a… aio: wait for session close Mar 14, 2020
@RazAnyVision RazAnyVision force-pushed the aio-wait-for-session-close branch from dfcf6d2 to 598813c Compare March 14, 2020 00:50
@RazAnyVision RazAnyVision changed the title aio: wait for session close aio: return session closing coroutine Mar 14, 2020
aio.Consul.close() uses aiohttp.ClientSession.close() which returns a coroutine that was never awaited. When this happens, RuntimeWarnings are raised on termination:

RuntimeWarning: coroutine 'ClientSession.close' was never awaited
  self._session.close()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fee7d894340>
Unclosed connector
connections: [<a long list of connections>]
connector: <aiohttp.connector.TCPConnector object at 0x7fee7d894310>

In this change the coroutine will be returned so it could be awaited and by that avoids these warnings.
@RazAnyVision RazAnyVision force-pushed the aio-wait-for-session-close branch from 02d7b08 to 709bda2 Compare March 14, 2020 01:00
@poppyred
Copy link

@RazAnyVision Interested in coming here

@cablehead cablehead force-pushed the master branch 2 times, most recently from 636f367 to a91daae Compare April 15, 2024 01:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants