[
https://issues.apache.org/jira/browse/HDFS-11846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16021929#comment-16021929
]
Xiaoyu Yao commented on HDFS-11846:
-----------------------------------
Thanks [~cheersyang] for reporting the issue and posting the fix. The patch
looks good to me overall. Just a few minor issues below.
1. OzoneClientUtils.java
Line 543-544: I see we are adding OZONE_CLIENT_SOCKET_TIMEOUT_MS for HTTP
request execution. Do we need a configure for HTTP Connection Timeout?
2. OzoneBucket.java
Line 325 we should ensure the outPutStream is closed properly in the final
section as well.
{code}
ByteArrayOutputStream outPutStream = new ByteArrayOutputStream();
{code}
3. OzoneClient.java
NIT: line 63-64: unnecessary change.
NIT: line 144: httppost-> httpPost?
similar naming for other variables like: httpget/httpdelete etc. for
contistency.
Line 619: As commented in TODO, I think we should use
PoolingHttpClientConnectionManager instead of creating a new connection for
each request. Please open a ticket for adding OzoneClientUtils.getHttpClient
with PoolingHttpClientConnectionManager if you don't plan to fix that with this
JIRA.
> Ozone: Potential http connection leaks in ozone clients
> -------------------------------------------------------
>
> Key: HDFS-11846
> URL: https://issues.apache.org/jira/browse/HDFS-11846
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: ozone
> Reporter: Weiwei Yang
> Assignee: Weiwei Yang
> Attachments: HDFS-11846-HDFS-7240.001.patch
>
>
> There are several problems
> # Http clients in {{OzoneVolume}}, {{OzoneBucket}} and {{OzoneClient}} are
> created per request, per [Reuse of HttpClient
> instance|http://hc.apache.org/httpclient-3.x/performance.html#Reuse_of_HttpClient_instance]
> doc, proposed to reuse the http client instance to reduce the over head.
> # Some resources in these classes were not properly cleaned up. E.g the http
> connection, HttpGet/HttpPost requests.
>
> This jira's purpose is to fix these issues and investigate how we can improve
> the client.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]