hashicorp / consul

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
https://www.consul.io
Other
28.37k stars 4.42k forks source link

[consul.aio] ClientSession.close was never awaited #14834

Open kidrahahjo opened 2 years ago

kidrahahjo commented 2 years ago

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>
subodhk01 commented 7 months ago

Strange no one ever commented on this