-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-4545] preparations for removing the network buffers parameter #3467
Conversation
These were unused except for unit tests and will be replaced with bounded BufferPool instances.
Hi @NicoK , I am interested in this issue and I like the way of asserting hold lock in this PR. It is really necessary to manage network buffers by framework, because it is difficult to set the exact number of buffers by users. And our current simple solution is to expand the From @StephanEwen mentioned before, I know a little for this issue. Would you share some detail designs for plans for it if have, then I can learn and track the progress in time. Thank you ! |
Hi @zhijiangW, |
…t partition type This removes JobVertex#connectNewDataSetAsInput(JobVertex input, DistributionPattern distPattern) and requires the developer to call JobVertex#connectNewDataSetAsInput(JobVertex input, DistributionPattern distPattern, ResultPartitionType partitionType) instead and think about the partition type to add.
These were implying a default result partition type which we want the developer to actively decide upon.
I think this is a good change, merging this... @zhijiangW Managing the buffers changes in some followup PR, first adjusting the local pools, then the global pool. Managing buffers in a global pool can help when caching data, such as for batch jobs. But we can take suggestions followup improvements as a separate thread, after this improvement is in. |
@@ -265,11 +281,15 @@ public String toString() { | |||
// ------------------------------------------------------------------------ | |||
|
|||
private void returnMemorySegment(MemorySegment segment) { | |||
assert Thread.holdsLock(availableMemorySegments); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I have a question about assert, because I found that assertion is disabled in java by default. why not use explicit synchronized(availableMemorySegments)
which may be more common usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using synchronized again would impact performance, while assertions only do when they are enabled which is the case in our unit tests (see https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#enableAssertions).
@NicoK ,thank you for explanation, and I already trace the code in your local branch. Wish your further change commit in global pool. @StephanEwen , thanks for further elaboration. From my understanding, each task can decide the core number of buffers in And my concern is to consider the memory usages in |
@zhijiangW Yes, let's discuss this when the feature is complete.
|
This PR includes some preparations for following PRs that ultimately lead to removing the network buffer parameter that was hard to tune.