question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] isfile/isfolder for non-existent items takes ~50s

See original GitHub issue

What happened:

Calling isile + isfolder for path abfs://c/f/2/3 when container & folder c/f/2/ exists but file 3 does not takes 25s + 25s.

What you expected to happen:

Expect to take < 1s, not 25s + 25s because calling the same az storage blob exists .... takes < 1s to get the error. This is extra surprising/negative due to asyncio support not landing yet or abfs, so it will block all other users of the python process

Minimal Complete Verifiable Example:

   %%time
    storage_options = {
        'account_name': os.environ['AZ_STORAGE_ACCOUNT_NAME'],
        'account_key': os.environ['AZ_STORAGE_ACCOUNT_KEY']    
    }
    fs = fsspec.filesystem('abfs', **storage_options)
    print(fs.isfile(path), fs.isdir(path))

Environment:

RAPIDS 0.19 stable (conda): fsspec '2021.07.0' dask ‘2021.04.0’ ubuntu

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
hayesgbcommented, Aug 15, 2021

Would you mind trying the master branch? The await error is due to an error is fixed there.

On Aug 15, 2021, at 4:42 PM, lmeyerov @.***> wrote:

@hayesgb thanks!

The original issue (here) was 404s taking 30s instead of < 1s. When updating to fsspec to 2021.08.1, that seems to now be fast!

The new issue (#265) is that files that do exist now incorrectly return fs.isfile(legit_path) == False) and an async warning. I’m trying to get asynchronous=True … await fs._isfile(path) to work as a workaround, but haven’t figured that out yet. Before 2021.08.1, that worked fine in sync mode.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

0reactions
lmeyerovcommented, Aug 15, 2021

Checked – the warning is gone, but wrong result + dir exists check is slowly downloading everything (afaict) instead of just checking: https://github.com/dask/adlfs/issues/265

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] isfile/isfolder for non-existent items takes ~50s #261
What happened: Calling isile + isfolder for path abfs://c/f/2/3 when container & folder c/f/2/ exists but file 3 does not takes 25s +...
Read more >
Excessive calls to File.isDirectory() cause performance problems
File to log calls to this method showed two things: 1. ... MasterFS changes, you are probably the right one to take care...
Read more >
Better way to check if a Path is a File or a Directory?
From How to tell if path is file or directory: ... IsDirectory()); // non-existing directory, FileAttributes not conclusive, rely on type of FileSystemInfo ......
Read more >
Python: Check if a File or Directory Exists - GeeksforGeeks
isfile () method in Python is used to check whether the specified path is an existing regular file or not. Syntax: os.path.isfile(path).
Read more >
How to Delete This is No Longer located Files for Error "Verify ...
If you get the error "Could not find this item. This is no longer located in (path). Verify the items location and try...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found