Skip to content

Error:asyncio:Unclosed connector #129

Closed
@andersbogsnes

Description

@andersbogsnes

What happened:
When running upload/download scripts using adlfs, we get a warning on every run:

ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f2012e55820>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f2012ebcfa0>, 10699.800393553)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f2012e5585

While it is just a warning, it can be scary for end-users as it seems that something went wrong.

What you expected to happen:
No warning should be raised

Minimal Complete Verifiable Example:

import fsspec
from adlfs import AzureBlobFileSystem

fs: AzureBlobFileSystem = fsspec.filesystem("az", account_name="andersdatalake",
                                          account_key="my_account_key")

with open("hello_fsspec.txt", mode="w") as f:
    f.write("Hello from fsspec!\n")

fs.put("hello_fsspec.txt", "/raw/hello_fsspec.txt")

Anything else we need to know?:

My immediate guess is that it comes from not closing the credentials transport session per this issue: Azure/azure-sdk-for-python/issues/8990 and this PR: Azure/azure-sdk-for-python/pull/9090

If that is the source, I imagine the fix would be to call close on the credentials object, but I'm not sure where in the lifecycle to do that.

Environment:

  • adlfs: 0.5.5
  • Dask version: N/A
  • Python version: 3.8
  • Operating System:Ubuntu 20.04
  • Install method (conda, pip, source): pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions