RFR: 8294047: HttpResponseInputStream swallows interrupts [v9]
Darragh Clarke
duke at openjdk.org
Mon Dec 5 15:14:21 UTC 2022
On Mon, 5 Dec 2022 14:13:42 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> 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.
I think that's a good point, I don't really have a strong opinion one way or the other on it but would be curious if anyone else does?
-------------
PR: https://git.openjdk.org/jdk/pull/11323
More information about the net-dev
mailing list