consul icon indicating copy to clipboard operation
consul copied to clipboard

[consul.aio] ClientSession.close was never awaited

Open kidrahahjo opened this issue 2 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