Skip to content

[Bug]: S3Path is not thread-safe #4

Open

Description

@hugolytics

Describe the Bug

s3path uses a "global" session, therefore all clients are shared by this session. In a multithreaded environment (such as most data orchestration platforms) this causes errors.

...

when running S3Path in for example a kedro session, the connection to AWS is unstable resulting in end_point resolver errors.

...

Describe your Environment:

  • Operation System: MacOS / Linux
  • What Python: Pypi
  • Python version: 3.10
  • Network environment: cloud

Activity

  1. added
    bug
    on Aug 17, 2022
  2. MacHu-GWU commented on Aug 30, 2022

    @MacHu-GWU
    Contributor

    @hugolytics I got your point. Could you put some code example here to show how to reproduce the error? pseudo is fine.

  3. MacHu-GWU commented on Sep 10, 2022

    @MacHu-GWU
    Contributor

    plan to fix this in 2.x.x no later than end of 2022

  4. MacHu-GWU commented on Nov 13, 2022

    @MacHu-GWU
    Contributor

    @hugolytics did lots of effort to see how can I fix this without breaking the API compatibility, but still working on it.

    I suggest using bsm argument explicitly in all of the API call. See example https://s3pathlib.readthedocs.io/en/latest/s3pathlib/core.html#s3pathlib.core.S3Path.upload_file

    I will update the doc to show that

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

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions