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

Shaofeng SHI commented on KYLIN-2429:
-------------------------------------

fixed in : 
https://github.com/apache/kylin/commit/11617a9ecd5161290612deda46eff6937f109ace

> Variable initialized should be declared volatile in 
> SparkCubingByLayer#execute()
> --------------------------------------------------------------------------------
>
>                 Key: KYLIN-2429
>                 URL: https://issues.apache.org/jira/browse/KYLIN-2429
>             Project: Kylin
>          Issue Type: Bug
>    Affects Versions: v2.0.0
>            Reporter: Ted Yu
>            Assignee: Shaofeng SHI
>             Fix For: v2.0.0
>
>
> {code}
>         final JavaPairRDD<ByteArray, Object[]> encodedBaseRDD = 
> intermediateTable.javaRDD().mapToPair(new PairFunction<Row, ByteArray, 
> Object[]>() {
>             transient boolean initialized = false;
> ...
>             public Tuple2<ByteArray, Object[]> call(Row row) throws Exception 
> {
>                 if (initialized == false) {
>                     synchronized (SparkCubingByLayer.class) {
>                         if (initialized == false) {
> {code}
> For double checked locking to work, initialized needs to be volatile.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to