RFR: 8294047: HttpResponseInputStream swallows interrupts [v9]

Daniel Fuchs dfuchs at openjdk.org
Mon Dec 5 14:15:56 UTC 2022


On Mon, 5 Dec 2022 07:29:47 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Darragh Clarke has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   check thread interrupt status is set
>
> src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java line 488:
> 
>> 486:                         close();
>> 487:                     } catch (IOException ignored) {
>> 488:                     }
> 
> I don't have specific opinion here and this is more of a question - should we be doing:
> 
> 
> } catch (InterruptedException ex) {
>     final IOException toThrow = new IOException(ex);
>     try {
>         close();
>     } catch (IOException ignored) {
>         toThrow.addSuppressed(ignored);
>     }
>     Thread.currentThread().interrupt();
>     throw toThrow;    
> }
> 
> i.e. should we be adding any failure to close() as a suppressed exception to the IOException that we throw?

I am not sure whether that would be helpful or confusing.

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

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


More information about the net-dev mailing list