Open mikroskeem opened 4 years ago
Similar issue was described in #454. It's unclear if Netty provides a good way of dealing with the situation like this, at least I didn't find any (the issue in Netty repo is open since 2017).
So it starts from the Netty... bummer.
There are multiple things happening here. As far as InputStream
has inherently blocking API, the code that fills-in data from network and the code that reads it have to run on different threads. I think an exception thrown on async thread pool could be captured and propagated back to InputStream
thread to be re-thrown there... but it would require some jiggling. I'm testing a few improvements to error handling, will see if I can cover this specific use case properly. Thanks for the report!
Reproduction is pretty simple: 1) Get yourself an InputStream (in my case, one from Minio SDK when getting an object from the storage - which originates from OkHttp) 2) Pass it into response body
{:body my-is}
3) Make client close connection prematurely (uh-oh, binary file being downloaded withcurl
into the terminal - by default curl does not allow that) 4) Aleph closes InputStream in different threadI run into following exception (OkHttp, or rather okio which backs said stream does not support that use-case):
Body + proxy class which delegates to the original stream (for debugging):
Also simple logging snippet which works ok with the test scenario:
I think that this is not right