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

Shaofeng SHI updated KYLIN-2716:
--------------------------------
    Fix Version/s:     (was: v2.1.0)
                   v2.2.0

As 2.1.0 release has been started, move this to next version.

> Using non-thread-safe WeakHashMap leading to server high cpu
> ------------------------------------------------------------
>
>                 Key: KYLIN-2716
>                 URL: https://issues.apache.org/jira/browse/KYLIN-2716
>             Project: Kylin
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: all
>            Reporter: Zhong Yanghong
>            Assignee: Zhong Yanghong
>             Fix For: v2.2.0
>
>         Attachments: APACHE-KYLIN-2716.patch
>
>
> Multiple threads invoke WeakHashMap.get() simultaneously may leading to a 
> dead loop in *WeakHashMap.get() -> getTable() -> expungeStaleEntries()*, 
> which finally resulting in server high cpu. There're two places using 
> WeakHashMap. 
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> One is used in the method *ClassUtil.forName()*. 
> We made an inner test by invoking the method *ClassUtil.forName()* 1M times, 
> the result is as follows:
> * With cache: 20ms;
> * Without cache: less than 2s.
> By invoking the method *ClassUtil.forName()* with *newInstance()* 1M times, 
> the result is as follows:
> * With cache: around 2s
> * Without cache: around 3s.
> Considering *ClassUtil.forName()* is always invoked with *newInstance()*, 
> there's no much downgrade without cache. Thus the fix is just to remove the 
> cache.
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> Another is used in the method *CubeService.getHTableInfo()*. We changed the 
> WeakHashMap to Guava Cache with introducing size & time limitation.



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

Reply via email to