Uh oh!
There was an error while loading. Please reload this page.
[SPARK-23457][SQL] Register task completion listeners first in ParquetFileFormat - #20619
[SPARK-23457][SQL] Register task completion listeners first in ParquetFileFormat#20619dongjoon-hyun wants to merge 3 commits into
Conversation
dongjoon-hyun
commented
Feb 15, 2018
Hi, @cloud-fan and @gatorsmile . |
| // UnsafeRowParquetRecordReader appends the columns internally to avoid another copy. | ||
| if (parquetReader.isInstanceOf[VectorizedParquetRecordReader] && | ||
| enableVectorizedReader) { | ||
| if (enableVectorizedReader) { |
There was a problem hiding this comment.
Would it be possible to merge this if-statement into the above if-statement?
There was a problem hiding this comment.
Yep. It looks possible. I'll update together after getting more reviews. Thanks, @kiszk .
There was a problem hiding this comment.
yea it seems more reasonable to merge this if-else now.
gatorsmile
commented
Feb 15, 2018
| } | ||
| val iter = new RecordReaderIterator(parquetReader) | ||
| taskContext.foreach(_.addTaskCompletionListener(_ => iter.close())) |
There was a problem hiding this comment.
According to the reported leakage, this is too late.
SparkQA
commented
Feb 15, 2018
Test build #87482 has finished for PR 20619 at commit
|
kiszk
commented
Feb 16, 2018
It looks good to me that we move the registrations to the new (earlier) places. |
| val vectorizedReader = new VectorizedParquetRecordReader( | ||
| convertTz.orNull, enableOffHeapColumnVector && taskContext.isDefined, capacity) | ||
| val recordReaderIterator = new RecordReaderIterator(vectorizedReader) | ||
| // Register a task completion lister before `initalization`. |
There was a problem hiding this comment.
could new VectorizedParquetRecordReader or new RecordReaderIterator fail?
There was a problem hiding this comment.
Those constructors didn't look heavy to me.
cloud-fan
commented
Feb 16, 2018
can we provide a manual test like the OOM one in your ORC PR? |
dongjoon-hyun
commented
Feb 16, 2018
Yep. I'll try for this, too. @cloud-fan . |
dongjoon-hyun
commented
Feb 17, 2018
The reproducible test case is added into PR description and the code is updated according to @kiszk and @cloud-fan 's comments. |
cloud-fan
commented
Feb 17, 2018
LGTM |
Thank you for last-minute review before your vacation. I'm lucky. :) |
gatorsmile
commented
Feb 17, 2018
He is already on vacation. : ) |
SparkQA
commented
Feb 17, 2018
Test build #87516 has finished for PR 20619 at commit
|
Oh.. It was a review from a vacation. |
dongjoon-hyun
commented
Feb 17, 2018
Retest this please. |
dongjoon-hyun
commented
Feb 17, 2018
The failure is irrelevant to this PR. |
SparkQA
commented
Feb 17, 2018
Test build #87518 has finished for PR 20619 at commit
|
gatorsmile
commented
Feb 17, 2018
retest this please |
dongjoon-hyun
commented
Feb 17, 2018
Thank you for retriggering, @gatorsmile . |
SparkQA
commented
Feb 17, 2018
Test build #87520 has finished for PR 20619 at commit
|
kiszk
commented
Feb 17, 2018
Would it be worth to add this JIRA number in a comment as we did for ORC? |
kiszk
commented
Feb 17, 2018
retest this please |
SparkQA
commented
Feb 17, 2018
Test build #87523 has finished for PR 20619 at commit
|
kiszk
commented
Feb 17, 2018
Umm, we still see the following exception in the log ... |
dongjoon-hyun
commented
Feb 17, 2018
Yep. @kiszk . @mgaido91 also reports that, so I'm investigating that more. However, that doesn't mean this approach is not proper. You can see the manual test case example in previous ORC-related PR and this PR. This approach definitely reduces the number of point of failures. For the remaining issue, I think we may need a different approach in a different code path. |
For the following, I'll create another one.
|
mgaido91
commented
Feb 17, 2018
LGTM |
dongjoon-hyun
commented
Feb 17, 2018
Thank you for review, @mgaido91 . |
kiszk
commented
Feb 17, 2018
LGTM with one minor comment |
dongjoon-hyun
commented
Feb 17, 2018
Thank you, @kiszk . I added SPARK-23390 in the PR description.
|
dongjoon-hyun
commented
Feb 17, 2018
Retest this please. |
dongjoon-hyun
commented
Feb 17, 2018
Oh, @kiszk . The following meat really
|
| val vectorizedReader = new VectorizedParquetRecordReader( | ||
| convertTz.orNull, enableOffHeapColumnVector && taskContext.isDefined, capacity) | ||
| val iter = new RecordReaderIterator(vectorizedReader) | ||
| // SPARK-23457 Register a task completion lister before `initialization`. |
There was a problem hiding this comment.
Now, SPARK-23457 is added.
SparkQA
commented
Feb 17, 2018
Test build #87527 has finished for PR 20619 at commit
|
SparkQA
commented
Feb 17, 2018
Test build #87528 has finished for PR 20619 at commit
|
dongjoon-hyun
commented
Feb 17, 2018
The final failure is irrelevant to this. |
dongjoon-hyun
commented
Feb 17, 2018
Retest this please. |
SparkQA
commented
Feb 18, 2018
Test build #87533 has finished for PR 20619 at commit
|
kiszk
commented
Feb 18, 2018
retest this please |
SparkQA
commented
Feb 18, 2018
Test build #87534 has finished for PR 20619 at commit
|
kiszk
commented
Feb 18, 2018
retest this please |
SparkQA
commented
Feb 18, 2018
Test build #87535 has finished for PR 20619 at commit
|
viirya
commented
Feb 18, 2018
retest this please. |
SparkQA
commented
Feb 18, 2018
Test build #87537 has finished for PR 20619 at commit
|
cloud-fan
commented
Feb 20, 2018
thanks, merging to master! |
dongjoon-hyun
commented
Feb 20, 2018
Thank you all! |
dongjoon-hyun
commented
Mar 1, 2018
Hi, @cloud-fan . |
cloud-fan
commented
Mar 2, 2018
Yea, please go ahead. |
dongjoon-hyun
commented
Mar 2, 2018
Thank you, @cloud-fan ! |
What changes were proposed in this pull request?
ParquetFileFormat leaks opened files in some cases. This PR prevents that by registering task completion listers first before initialization.
How was this patch tested?
Manual. The following test case generates the same leakage.