Skip to content

aiohttp SecretClient not closing session. #16757

Closed

Description

  • Package Name: azure-keyvault-secrets
  • Package Version: 4.2.0
  • Operating System: Ubuntu 18
  • Python Version: 3.8

Describe the bug
When running is Azure Functions, after using the aio SecretClient's context manager, I receive the following error:

Unclosed connector connections: [[(<aiohttp.client_proto.ResponseHandler object at 0x7f274ad97e80>, 1654.2421122)]] connector: <aiohttp.connector.TCPConnector object at 0x7f274adc00d0>

I am aware this bug was "fixed" here: #8990

I have followed the instructions here: https://docs.microsoft.com/en-us/python/api/overview/azure/keyvault-keys-readme?view=azure-python#async-api

To Reproduce
Steps to reproduce the behavior:

  1. Create an Azure function (timer triggered in my case)
  2. Use the aio SecretClient and DefaultAzureCredential using a context manager
from azure.identity.aio import DefaultAzureCredential
from azure.keyvault.secrets.aio import SecretClient
async def main(...):
    credential = DefaultAzureCredential()
    client = SecretClient(KEY_VAULT_URL, credential=credential)
    async with client:
        # Use client
  1. Run with func start or in a deployed Azure Function

Expected behavior
Azure function success.

Actual behavior
I get the following error after execution:

Unclosed connector connections: [[(<aiohttp.client_proto.ResponseHandler object at 0x7f274ad97e80>, 1654.2421122)]] connector: <aiohttp.connector.TCPConnector object at 0x7f274adc00d0>

Screenshots
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.DocsKeyVaultbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions