RFR: 8294047: HttpResponseInputStream swallows interrupts [v4]

Daniel Fuchs dfuchs at openjdk.org
Wed Nov 30 10:42:21 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 ?

By convention, any method that exits by throwing an InterruptedException clears interrupt status when it does so. Since we're throwing InterruptedIOException here, I don't think we need to set the interrupt flag. But the caller might do so if they want.

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

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


More information about the net-dev mailing list