Repository navigation
Core: Fix ParallelIterable memory leak where queue continues to be populated even after iterator close - #9402
Merged
Conversation
Contributor
Author
|
see #7844 for whole discuss |
Heltman
force-pushed
the
parallel_memory_leak_fix
branch
from
January 4, 2024 01:53
9793b4a to
5e40a9e
Compare
Contributor
Author
|
Any plans for when this will be released? Thank you |
Contributor
Heltman
force-pushed
the
parallel_memory_leak_fix
branch
from
June 28, 2024 06:38
5e40a9e to
27f74d1
Compare
nastra
reviewed
Jun 28, 2024
nastra
reviewed
Jun 28, 2024
nastra
reviewed
Jun 28, 2024
nastra
reviewed
Jun 28, 2024
nastra
reviewed
Jun 28, 2024
Contributor
|
Overall the change makes sense, just a few small comments to address |
Heltman
force-pushed
the
parallel_memory_leak_fix
branch
from
June 28, 2024 07:37
27f74d1 to
52c19ae
Compare
…added even if iterator exited
Heltman
force-pushed
the
parallel_memory_leak_fix
branch
from
June 28, 2024 07:39
52c19ae to
bb2888d
Compare
Contributor
Author
|
@nastra @raunaqmorarka Thanks for review and attention about this. |
nastra
approved these changes
Jun 28, 2024
nastra
left a comment
Contributor
There was a problem hiding this comment.
LGTM, I verified that this fixes the underlying issue. I'll leave the PR open for a bit to give others a chance to review this as well
Fokko
approved these changes
Jun 28, 2024
findepi
approved these changes
Jun 28, 2024
amogh-jahagirdar
approved these changes
Jul 1, 2024
amogh-jahagirdar
left a comment
Contributor
There was a problem hiding this comment.
Thanks @Heltman for fixing this leak, I also agree with this solution since the population of the queue can't really be "interrupted". I'll go ahead and merge.
Contributor
This was referenced Jul 12, 2024
jasonf20
pushed a commit
to jasonf20/iceberg
that referenced
this pull request
Aug 4, 2024
…pulated even after iterator close (apache#9402)
szehon-ho
pushed a commit
to szehon-ho/iceberg
that referenced
this pull request
Sep 16, 2024
* Core: Fix ParallelIterable memory leak where queue continues to be populated even after iterator close (apache#9402) (cherry picked from commit d3cb1b6) * Core: Limit ParallelIterable memory consumption by yielding in tasks (apache#10691) ParallelIterable schedules 2 * WORKER_THREAD_POOL_SIZE tasks for processing input iterables. This defaults to 2 * # CPU cores. When one or some of the input iterables are considerable in size and the ParallelIterable consumer is not quick enough, this could result in unbounded allocation inside `ParallelIterator.queue`. This commit bounds the queue. When queue is full, the tasks yield and get removed from the executor. They are resumed when consumer catches up. (cherry picked from commit 7831a8d) * Drop ParallelIterable's queue low water mark (apache#10978) As part of the change in commit 7831a8d, queue low water mark was introduced. However, it resulted in increased number of manifests being read when planning LIMIT queries in Trino Iceberg connector. To avoid increased I/O, back out the change for now. (cherry picked from commit bcb3281) --------- Co-authored-by: Helt <[email protected]> Co-authored-by: Piotr Findeisen <[email protected]>
zachdisc
pushed a commit
to zachdisc/iceberg
that referenced
this pull request
Dec 23, 2024
…pulated even after iterator close (apache#9402)
zhongyujiang
pushed a commit
to zhongyujiang/iceberg
that referenced
this pull request
Apr 16, 2025
…pulated even after iterator close (apache#9402) (cherry picked from commit d3cb1b6)
fbertsch
pushed a commit
to fbertsch/iceberg
that referenced
this pull request
Jan 19, 2026
…pulated even after iterator close apache#9402
cbb330
pushed a commit
to cbb330/iceberg
that referenced
this pull request
Jun 4, 2026
Core: Fix ParallelIterable memory leak where queue continues to be populated even after iterator close (#9402) (cherry picked from commit d3cb1b6)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch is a part for fix #7843 , we will need to add
BlockingParallelIterableto fix the whole problem.