RFR: 8294047: HttpResponseInputStream swallows interrupts [v3]
Daniel Fuchs
dfuchs at openjdk.org
Mon Nov 28 14:13:40 UTC 2022
On Mon, 28 Nov 2022 13:18:40 GMT, Darragh Clarke <duke at openjdk.org> wrote:
>> Currently if a `HttpResonseInputStream` gets interrupted while reading it will just swallow the exception and continue,
>>
>> This PR changes it to close the stream and throw an IOException, I added a test to cover this which just uses two threads to read the stream then interrupt it.
>
> Darragh Clarke has updated the pull request incrementally with one additional commit since the last revision:
>
> set initCause for InterruptedIOException
src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java line 489:
> 487: } catch (IOException ignored) {
> 488: }
> 489: // Throw InterruptedIOException where the initCause is set to the caught InterruptedException
nit: could you break this long line after "is"
src/java.net.http/share/classes/jdk/internal/net/http/common/Utils.java line 1141:
> 1139: interruptedIOException.initCause(ex);
> 1140: return interruptedIOException;
> 1141: }
The copyright years need updating.
-------------
PR: https://git.openjdk.org/jdk/pull/11323
More information about the net-dev
mailing list