GitHub user kunal642 opened a pull request:
https://github.com/apache/carbondata/pull/2945
[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.
Be sure to do all of the following checklist to help us incorporate
your contribution quickly and easily:
- [ ] Any interfaces changed?
- [ ] Any backward compatibility impacted?
- [ ] Document update required?
- [ ] Testing done
Please provide details on
- Whether new unit test cases have been added or why no new tests
are required?
- How it is tested? Please attach test report.
- Is it a performance related change? Please attach the performance
test report.
- Any additional information to help reviewers in testing this
change.
- [ ] For large changes, please consider breaking it into sub-tasks under
an umbrella JIRA.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/kunal642/carbondata bug/CARBONDATA-3123
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/carbondata/pull/2945.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2945
----
commit cce1811fa518545b6b31246efd5668048e7d24ea
Author: kunal642 <kunalkapoor642@...>
Date: 2018-11-23T05:41:44Z
[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.
----
---