Repository: carbondata
Updated Branches:
  refs/heads/master 0f5e898b3 -> b716865bf


[CARBONDATA-3123] Fixed JVM crash issue with CarbonRecordReader(SDK Reader).

Problem:
As CarbonReaderBuilder is executed on the main thread therefore while Reader 
creation we are setting TaskId to threadlocal. When multiple readers are 
created using the split API then the TaskID for the last initialized reader 
would be overridden and all the readers will use the same TaskID.
Due to this when one reader is reading and the other reader is freeing memory 
after its task completion the same memory block would be cleared and read at 
the same time causing SIGSEGV error.

Solution:
Do not set TaskID to thread local while Reader Initialization. 
ThreadLocalTaskInfo.getCarbonTaskInfo will take care of assigning new TaskID if 
not already present.

This closes #2945


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/b716865b
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/b716865b
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/b716865b

Branch: refs/heads/master
Commit: b716865bfe99e2883198b8c199f0dd854e489309
Parents: 0f5e898
Author: kunal642 <[email protected]>
Authored: Fri Nov 23 11:11:44 2018 +0530
Committer: ravipesala <[email protected]>
Committed: Tue Nov 27 12:10:06 2018 +0530

----------------------------------------------------------------------
 .../main/java/org/apache/carbondata/sdk/file/CarbonReader.java | 6 ------
 1 file changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/b716865b/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReader.java
----------------------------------------------------------------------
diff --git 
a/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReader.java 
b/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReader.java
index ebe0651..9666cfa 100644
--- a/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReader.java
+++ b/store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonReader.java
@@ -26,9 +26,6 @@ import 
org.apache.carbondata.common.annotations.InterfaceAudience;
 import org.apache.carbondata.common.annotations.InterfaceStability;
 import org.apache.carbondata.core.constants.CarbonCommonConstants;
 import org.apache.carbondata.core.util.CarbonProperties;
-import org.apache.carbondata.core.util.CarbonTaskInfo;
-import org.apache.carbondata.core.util.CarbonUtil;
-import org.apache.carbondata.core.util.ThreadLocalTaskInfo;
 import org.apache.carbondata.hadoop.CarbonRecordReader;
 import org.apache.carbondata.hadoop.util.CarbonVectorizedRecordReader;
 
@@ -66,9 +63,6 @@ public class CarbonReader<T> {
     this.readers = readers;
     this.index = 0;
     this.currentReader = readers.get(0);
-    CarbonTaskInfo carbonTaskInfo = new CarbonTaskInfo();
-    carbonTaskInfo.setTaskId(CarbonUtil.generateUUID());
-    ThreadLocalTaskInfo.setCarbonTaskInfo(carbonTaskInfo);
   }
 
   /**

Reply via email to