You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Carter Kozak (Jira)" <ji...@apache.org> on 2020/08/06 16:46:00 UTC

[jira] [Closed] (HTTPCORE-640) Response out of order detection fails on java 13+ plain http connections

     [ https://issues.apache.org/jira/browse/HTTPCORE-640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carter Kozak closed HTTPCORE-640.
---------------------------------
    Resolution: Not A Bug

I was wrong about this change. {{Socket.getInputStream().available)}} still works in jdk13 and beyond, however it doesn't report received data as quickly as before. This means fast networks may still encounter hangs when servers don't drain request bytes, but in most cases the buffers are large enough that responses are still detected. My test was run locally using a loopback interface where {{stream.available()}} never produced a nonzero value in time.

> Response out of order detection fails on java 13+ plain http connections
> ------------------------------------------------------------------------
>
>                 Key: HTTPCORE-640
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-640
>             Project: HttpComponents HttpCore
>          Issue Type: New Feature
>          Components: HttpCore
>    Affects Versions: 5.0.1
>            Reporter: Carter Kozak
>            Priority: Major
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> Response out of order detection relies on socket.getInputStream().available(), which works for non-ssl sockets on java releases up to and including 12. This approach appears not to work as expected on java 13 and newer due to the socket refactor [https://openjdk.java.net/jeps/353] as the socket inputstream is no longer a FileInputStream.
> My proposal is to update the check from "socket instanceof SSLSocket" to "!(socketInputStream instanceof FileInputStream)" to take into account both jep353 and the fast path on plain connections in older java versions.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org