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

Aiohttp session not being closed when using nest-asyncio #43

Closed
jacobtomlinson opened this issue Apr 30, 2023 · 1 comment
Closed

Aiohttp session not being closed when using nest-asyncio #43

jacobtomlinson opened this issue Apr 30, 2023 · 1 comment
Labels
bug Something isn't working kr8s

Comments

@jacobtomlinson
Copy link
Member

Since introducing nest-asyncio in #42 the aiohttp session close finaliser isn't working.

This should close the session.

asyncio_atexit.register(self._session.close)

But it isn't working.

Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fedfd56afb0>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fedfd5cdd80>, 1258910.377873378)]']
connector: <aiohttp.connector.TCPConnector object at 0x7fedfd5bd720>

Looks like this is an incompatibility between how nest-asyncio and asyncio-atexit are patching asyncio, see minrk/asyncio-atexit#3.

@jacobtomlinson jacobtomlinson added bug Something isn't working kr8s labels Apr 30, 2023
This was referenced May 1, 2023
@jacobtomlinson jacobtomlinson changed the title Aiohttp session not being closed Aiohttp session not being closed when using nest-asyncio May 1, 2023
@jacobtomlinson
Copy link
Member Author

Removed nest-asyncio in #44 for now which resolves this. But may need to revisit this to close #41.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kr8s
Projects
None yet
Development

No branches or pull requests

1 participant