Lots of accesses generated sometimes when using simplecache:: #1869
-
Hello, I have a slightly unusual question I'm sure, but I'm a bit at a loss as to where to ask for help. Redirects are welcome. I'm opening a file with uproot, which uses fsspec as part of the backend. I'm using an address like In both cases, I'm enabling additional logging via:
The output I get from fsspec for most files looks something like this:
The logging in For some files — and I've not found a pattern yet, it seems somewhat random to me, and does not always happen even with the same file — I instead get hundreds of lines like:
with no corresponding cache logging. Digging a bit more, the output seems to almost all be coming from
So: does anyone have some explanation for why this might be happening, how to make sure Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
Sorry, should've said that this was also reported to the uproot team here: |
Beta Was this translation helpful? Give feedback.
-
It's not at all obvious how uproot interfaces with fsspec. The code sample looked like
I wonder whether uprooot accepts the following instead with fsspec.open("simplecache::https://....root") as f:
with uproot.open(f) as ff:
# code or similar. Alternatively, fsspec.open_local can give you the local path of the cached file, so you can pass that instead. As you suggest, we would expect there to be only one call to get_file(), although that might result in multiple requests, one per block. |
Beta Was this translation helpful? Give feedback.
-
Hi all, I've gotten a little further in understanding this, but I think I'm still stuck, so I wanted to pass along a little update. Here's a much simpler reproducer of our problem:
Then comes to looping part, in The accesses in there seem to use direct calls to Because of all the futures in this code, it's rather laborious to track down what's going on. Suggestions and/or help are welcome, of course. Best, |
Beta Was this translation helpful? Give feedback.
-
Closed via #1881 |
Beta Was this translation helpful? Give feedback.
It is possible, then, that all you need if for cat_file/_cat_file to be implemented for SimpleCache . The classes were definitely built for the file-lie API in mind, but I am surprised that cat is falling back to the remote filesystem.