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

ASF GitHub Bot commented on KYLIN-3633:
---------------------------------------

shaofengshi commented on a change in pull request #301: KYLIN-3633 Avoid 
potential dead lock when building global dictionary
URL: https://github.com/apache/kylin/pull/301#discussion_r227015785
 
 

 ##########
 File path: 
core-dictionary/src/main/java/org/apache/kylin/dict/DictionaryGenerator.java
 ##########
 @@ -75,13 +75,19 @@ public static IDictionaryBuilder 
newDictionaryBuilder(DataType dataType) {
         builder.init(dictInfo, baseId, null);
 
         // add values
-        while (valueEnumerator.moveNext()) {
-            String value = valueEnumerator.current();
+        try {
+            while (valueEnumerator.moveNext()) {
+                String value = valueEnumerator.current();
 
-            boolean accept = builder.addValue(value);
+                boolean accept = builder.addValue(value);
 
-            if (accept && samples.size() < nSamples && samples.contains(value) 
== false)
-                samples.add(value);
+                if (accept && samples.size() < nSamples && 
samples.contains(value) == false)
+                    samples.add(value);
+            }
+        } catch (Throwable e) {
 
 Review comment:
   Use "Throwable" is not recommended; please use a concrete exception type 
instead.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Dead lock may happen in building global dictionary
> --------------------------------------------------
>
>                 Key: KYLIN-3633
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3633
>             Project: Kylin
>          Issue Type: Bug
>          Components: Measure - Count Distinct
>    Affects Versions: v2.4.1
>            Reporter: nichunen
>            Assignee: nichunen
>            Priority: Major
>
> During the building of global dict, if an error happens, the builder's lock 
> maybe un-released. This will block all other building jobs with global dict.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to