RFR: 8294047: HttpResponseInputStream swallows interrupts

Darragh Clarke duke at openjdk.org
Thu Nov 24 16:39:20 UTC 2022


On Wed, 23 Nov 2022 15:10:14 GMT, Daniel Fuchs <dfuchs 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.
>
> test/jdk/java/net/httpclient/HttpResponseInputStreamInterruptTest.java line 107:
> 
>> 105:     static class Handler implements HttpHandler {
>> 106: 
>> 107:         CountDownLatch countDownLatch;
> 
> Maybe a better name than `countDownLatch` could be found - that could give a clue on what this latch is used to wait for?

I was thinking maybe `messageLatch`, `messageReceivedLatch` or `clientReadyLatch`

-------------

PR: https://git.openjdk.org/jdk/pull/11323


More information about the net-dev mailing list