consul icon indicating copy to clipboard operation
consul copied to clipboard

[consul.aio] ClientSession.close was never awaited

Open kidrahahjo opened this issue 3 years ago • 1 comments

Overview of the Issue

During teardown, consul tries to close the active session but since ClientSession.close is in async function, it has to be awaited in order for the session to be closed.

Reproduction Steps

# script.py
from consul.aio import Consul

client = Consul()

After running this script, you'll run into the following warning:

RuntimeWarning: coroutine 'ClientSession.close' was never awaited
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fb609145b80>

kidrahahjo avatar Oct 03 '22 07:10 kidrahahjo

Strange no one ever commented on this

subodhk01 avatar Mar 20 '24 08:03 subodhk01

Having the same... Using aiortc. No idea what

ERROR:asyncio:Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f9825da30> ERROR:asyncio:Task was destroyed but it is pending!

neilyoung avatar Nov 02 '24 13:11 neilyoung

It looks like you are looking for assistance with a third party python library for interfacing with Consul. That is not maintained by Hashicorp. Please use our forums for this type of assistance: https://discuss.hashicorp.com/c/consul

rboyer avatar Nov 06 '24 19:11 rboyer