RFR: 8294047: HttpResponseInputStream swallows interrupts [v4]
Daniel Fuchs
dfuchs at openjdk.org
Wed Nov 30 11:03:19 UTC 2022
On Wed, 30 Nov 2022 05:19:22 GMT, Vyom Tewari <vtewari at openjdk.org> wrote:
>> Darragh Clarke has updated the pull request incrementally with one additional commit since the last revision:
>>
>> fixed copyright year and formatting of a comment
>
> src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java line 491:
>
>> 489: // Throw InterruptedIOException where the initCause is
>> 490: // set to the caught InterruptedException
>> 491: throw Utils.toInterruptedIOException(ex);
>
> Don't you think you need to restores the interrupt status of the thread by invoking the Thread.currentThread().interrupt() method and allowing the caller to detect the interrupt if it needs to ?
Hmmm... Maybe a better solution would be to throw "ClosedByInterruptException" since we're also closing the input stream. And the specification of "ClosedByInterruptException" clearly state that the interrupt status of the thread will be preserved. Good question @vyommani .
-------------
PR: https://git.openjdk.org/jdk/pull/11323
More information about the net-dev
mailing list