You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Billy Liu (JIRA)" <ji...@apache.org> on 2017/09/09 14:14:02 UTC

[jira] [Commented] (KYLIN-2862) BasicClientConnManager in RestClient can't do well with syncing many query severs

    [ https://issues.apache.org/jira/browse/KYLIN-2862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16159953#comment-16159953 ] 

Billy Liu commented on KYLIN-2862:
----------------------------------

Hi [~whisper_deng], thanks for the patch. Could you make the parameter configurable? 

> BasicClientConnManager in RestClient can't do well with syncing many query severs
> ---------------------------------------------------------------------------------
>
>                 Key: KYLIN-2862
>                 URL: https://issues.apache.org/jira/browse/KYLIN-2862
>             Project: Kylin
>          Issue Type: Bug
>          Components: General
>    Affects Versions: v2.1.0
>            Reporter: Fangyuan Deng
>         Attachments: KYLIN-2862.0.patch
>
>
> In KYLIN-2814 , it fixs some kinds of sync wipe fails.
> After we use this patch , sync wipe fails  still often happen, the log is like this.
> 2017-09-08 21:28:13,029 WARN  [pool-10-thread-2] cachesync.Broadcaster:137 : Thread failed during wipe cache at BroadcastEvent{entity=cube, event=update, cacheKey=olap_nh_log_all_di_cube}, error msg: java.lang.IllegalStateException: Invalid use of BasicClientConnManager: connection still allocated.
> Make sure to release the connection before allocating another one.
> We search the code, then we found  ,   the DefaultHttpClient uses BasicClientConnManager as default ConnManager.
> and the BasicClientConnManager is a simple connection manager that maintains only one connection at a time. Even though this class is thread-safe it ought to be used by one execution thread only.
>  if we have many query servers,  the BasicClientConnManager will be bottleneck.
> so we use PoolingClientConnectionManager instead,  which can manages a pool of client connections and is able to service connection requests from multiple execution threads.
> Then everything goes fine. the code is below
> final PoolingClientConnectionManager cm = new PoolingClientConnectionManager();
> cm.setDefaultMaxPerRoute(20);
> cm.setMaxTotal(200);
> client = new DefaultHttpClient(cm, httpParams);
> see more about BasicClientConnManager and PoolingClientConnectionManager
> http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d5e619



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)