Skip to content

All async Azure storage account connections hang with SSL shutdown timeout errors in latest version of aiohttp #41363

@JamieForsythe

Description

@JamieForsythe
  • Package Name: azure-data-tables/azure-storage-file-share
  • Package Version: 12.7.0/12.21.0
  • Operating System: macOS Sequoia v15.5
  • Python Version: 3.11.12

Describe the bug
Since the release of version 3.12.4 of aiohttp yesterday, any asynchronous connections to Azure tables or file shares within a storage account seem to hang for 30 seconds after completing, and following this there is an error message logged - "Error while closing connector: ClientConnectionError('Connection lost: SSL shutdown timed out')"

We've tested the following scenarios:

  • Tested this both on a local Mac and on a Linux GitHub Actions runner, with the same result on both.
  • Tested connecting to a CosmosDB account through the azure-cosmos package which also uses aiohttp, and this works fine, which leads me to believe the issue is storage-account related, rather than the wider Azure SDK or aiohttp itself.
  • Tested connecting to multiple different storage accounts - same result for all.
  • Tested connecting to tables and file shares - I suspect blob storage and queues have the same problem, but haven't explicitly tested.

The issue only seems to occur if you actually perform an action on a table/file share - if you just connect but don't do anything, that's fine.

To Reproduce
Steps to reproduce the behavior:

  1. See the below Python script that replicates the issue:
import asyncio
import logging

from azure.data.tables.aio import TableServiceClient

logger = logging.getLogger(__name__)


async def create_table_with_async_table_service_client() -> None:
    logger.info("Creating table asynchronously...")
    async with TableServiceClient.from_connection_string("<connection_string>") as table_service_client:
        await table_service_client.create_table_if_not_exists("TestTable")
        logger.info("TestTable created successfully or already exists")
    logger.info("AsyncTableServiceClient exited successfully")


async def do_nothing_in_async_table_service_client() -> None:
    logger.info("Doing nothing in AsyncTableServiceClient...")
    async with AsyncTableServiceClient.from_connection_string("<connection_string>"):
        logger.info("AsyncTableServiceClient is ready for use - doing nothing")
    logger.info("AsyncTableServiceClient exited successfully")


async def main() -> None:
    logging.basicConfig(level=logging.INFO)

    await create_table_with_async_table_service_client()
    await do_nothing_in_async_table_service_client()


if __name__ == "__main__":
    asyncio.run(main())

Expected behavior
In above script, the create_table_with_async_table_service_client function will hang upon exiting the TableServiceClient async context manager, and an error will eventually be logged to the root logger, saying that the SSL shutdown timed out. The do_nothing_in_async_table_service_client function will run normally without this issue.

EDIT: misunderstood this section earlier - expected behaviour is obviously that the table service client closes without an SSL shutdown timeout error and without the 30s delay

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Pinning aiohttp to an earlier version works as a temporary workaround to prevent the mass slowdown resulting from all asynchronous storage account connections hanging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.issue-addressedWorkflow: The Azure SDK team believes it to be addressed and ready to close.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions