-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
- 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:
- 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.