Skip to content

Unclosed aiohttp ClientSession and TCPConnector after AzureDataFactoryRunPipelineOperator execution #55724

@stolarekms

Description

@stolarekms

Apache Airflow Provider(s)

microsoft-azure

Versions of Apache Airflow Providers

=10.4.0

Apache Airflow version

2.10.2

Operating System

Official Airflow image apache/airflow:2.10.2-python3.12 hosted on AKS

Deployment

Official Apache Airflow Helm Chart

Deployment details

Official Airflow image apache/airflow:2.10.2-python3.12 hosted on AKS

What happened

This issue resembles Unclosed connector / client session when using asyncio #13242
However, it occurs when triggering an Azure Data Factory pipeline via Airflow using the AzureDataFactoryRunPipelineOperator.

Regardless of whether the pipeline completes successfully or fails, the following error is consistently logged:

[2025-09-16, 15:08:11 CEST] {base_events.py:1820} ERROR - Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f80f1a34380>
[2025-09-16, 15:08:11 CEST] {base_events.py:1820} ERROR - Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f80f1bb1970>, 102727.274540543)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f80f1a34b00>

What you think should happen instead

Displaying the error message is not intended in this context.

How to reproduce

  1. Use AzureDataFactoryRunPipelineOperator to trigger an ADF pipeline.
  2. Wait for the pipeline to either succeed or fail.
  3. Observe the logs — the error appears regardless of the pipeline outcome.

Anything else

This occurs consistently upon task completion, irrespective of the pipeline's success or failure.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions