[ https://issues.apache.org/jira/browse/KYLIN-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16629781#comment-16629781 ]
ASF GitHub Bot commented on KYLIN-3584: --------------------------------------- shaofengshi closed pull request #259: KYLIN-3584, KYLIN-3585 URL: https://github.com/apache/kylin/pull/259 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java b/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java index 9b99d71712..c2edfdb336 100644 --- a/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java +++ b/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java @@ -51,7 +51,11 @@ public static DefaultScheduler getInstance() { if (INSTANCE == null) { - INSTANCE = createInstance(); + synchronized (DefaultScheduler.class) { + if (INSTANCE == null) { + INSTANCE = createInstance(); + } + } } return INSTANCE; } diff --git a/engine-spark/src/main/java/org/apache/kylin/engine/spark/SparkFactDistinct.java b/engine-spark/src/main/java/org/apache/kylin/engine/spark/SparkFactDistinct.java index 632a169400..5a591673d0 100644 --- a/engine-spark/src/main/java/org/apache/kylin/engine/spark/SparkFactDistinct.java +++ b/engine-spark/src/main/java/org/apache/kylin/engine/spark/SparkFactDistinct.java @@ -485,7 +485,7 @@ private int countSizeInBytes(String[] row) { private final int[] rowkeyColIndex; private final Long[] cuboidIds; private final Integer[][] cuboidsBitSet; - private volatile HLLCounter[] cuboidsHLL; + private HLLCounter[] cuboidsHLL; //about details of the new algorithm, please see KYLIN-2518 private final boolean isNewAlgorithm; ---------------------------------------------------------------- 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: us...@infra.apache.org > Incorrect lazy initialization of DefaultScheduler.INSTANCE > ---------------------------------------------------------- > > Key: KYLIN-3584 > URL: https://issues.apache.org/jira/browse/KYLIN-3584 > Project: Kylin > Issue Type: Bug > Reporter: Ted Yu > Priority: Minor > > Here is related code: > {code} > public static DefaultScheduler getInstance() { > if (INSTANCE == null) { > INSTANCE = createInstance(); > {code} > The check against may not be effective. -- This message was sent by Atlassian JIRA (v7.6.3#76005)