-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading files through HTTPS protocol results TypeError: a bytes-like object is required, not 'ServerDisconnectedError'
#1233
Comments
Smaller reproducer: import uproot
with uproot.open("https://xrootd-local.unl.edu:1094//store/user/AGC/samplegame/sample1.root") as f:
f["Events"] # this works
f["Events"].arrays("Jet_pt") # this breaks |
The small reproducer doesn't do it: >>> import uproot
>>> with uproot.open("https://xrootd-local.unl.edu:1094//store/user/AGC/samplegame/sample1.root") as f:
... f["Events"] # this works
... f["Events"].arrays("Jet_pt") # this breaks
...
<TTree 'Events' (431 branches) at 0x6ffffbf43290>
<Array [{Jet_pt: [57.5, ..., 15.3]}, ...] type='500000 * {Jet_pt: var * flo...'> but the big one does. Or it's random (because it's a If the server disconnected, then some error has to be raised about that (unless it's a rare failure to be skipped and filed in a report). The failing line is
which is to say that uproot5/src/uproot/source/coalesce.py Line 36 in 94e5199
isn't checking for the possibility that the return value of The coalesce.py submodule was added by @nsmith-, so maybe this line just needs something to handle the exception case. I'm still confused by the fact that it's returning, rather than raising, the exception, since uproot5/src/uproot/source/futures.py Lines 144 to 149 in 94e5199
puts the exception class, object, and traceback into uproot5/src/uproot/source/futures.py Lines 129 to 141 in 94e5199
raises the exception, rather than returning it, here: uproot5/src/uproot/source/futures.py Lines 34 to 38 in 94e5199
Some |
In the case of FSSpec (the only source currently using the coalescing algorithm), none of them are. They are python futures as prepared by uproot5/src/uproot/source/fsspec.py Line 167 in 94e5199
where self._executor is an instance of FSSpecLoopExecutor :uproot5/src/uproot/source/fsspec.py Lines 198 to 206 in 94e5199
I don't know yet why run_coroutine_threadsafe ends up setting the content instead of an exception
|
I will ask Carl to check server side logs and post them here... |
Same log entry on xfer5. The only thing catching my attention is :
From Carl: maybe https needs FS UID set? |
I opened PR xrootd/xrootd#2290 to add keep-alive support when XRootD is replying with HTTP redirections. This seemed to resolve the issue in limited local testing. When redirecting clients, XRootD indicates keep-alive support in the HTTP reply headers, but then immediately closes the connection. I'm guessing that if aiohttp tries to reuse the connection before the closure has been handled up the stack, we get the There's a fix on the aiohttp side, aio-libs/aiohttp#7363, which adds a retry. In testing, it did help, but didn't completely resolve the issue. The second attempt could also end up reusing a closed connection and fail. |
At the end @jthiltges 's xrootd patch fixed the issue on our side (the notebook is working back). As I understood it still needs to be tested further because of some failing tests, @jthiltges? |
That's correct. The PR needs a bit more work to get the HTTP keepalive working as expected, with details in the xrootd PR. I'm hoping to have something ready for testing early this week. |
Hi @jthiltges @oshadura |
Hi @bockjoo, I was only able to reproduce the issue when the redirector was involved and the client was using HTTP(S). The xrootd PR to handle keepalive when redirecting has been merged, and appears on-track for release in v5.7.1. Regards, |
Reading files through HTTPS protocol results:
TypeError: a bytes-like object is required, not 'ServerDisconnectedError'
Traceback: https://gist.github.com/oshadura/df21fcdf12c8ad9bac6b759ca164064c
Reproducer:
@nsmith-
The text was updated successfully, but these errors were encountered: