avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Andrews (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1069) HttpTransceiver never closes its OutputStream, hinders java reuse of HTTP connections
Date Fri, 27 Apr 2012 17:10:49 GMT

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

Thomas Andrews updated AVRO-1069:
---------------------------------

    Summary: HttpTransceiver never closes its OutputStream, hinders java reuse of HTTP connections
 (was: HttpTransceiver never closes its OutputStream)
    
> HttpTransceiver never closes its OutputStream, hinders java reuse of HTTP connections
> -------------------------------------------------------------------------------------
>
>                 Key: AVRO-1069
>                 URL: https://issues.apache.org/jira/browse/AVRO-1069
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Thomas Andrews
>
> The class org.apache.avro.ipc.HttpTransceiver opens an OutputStream and never explicitly
closes it.  That seems like very bad behavior.
> I think you should also be closing the InputStream.
> In particular, Java has built-in the ability to keep HttpURLConnections open, and re-use
them.  You might think that not closing these streams would help Java in this effort, but
actually, the streams are not the raw connections, but wrappers.  The javadoc says: "Calling
the close() methods on the InputStream or OutputStream of an HttpURLConnection after a request
may free network resources associated with this instance but has no effect on any shared persistent
connection."
> In other words, when you fail to close these streams, Java doesn't know you are done
with the request, so it cannot re-use the connection.  You only end up able to re-use the
connection when the HttpURLConnection gets garbage-collected.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message