-
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-11707][network] Make InputGate extend AutoCloseable #7785
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
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.
Thanks for opening the PR @zhijiangW !
I think it looks good, I left only one comment to discuss.
@@ -264,6 +265,23 @@ public int getPageSize() { | |||
return pageSize; | |||
} | |||
|
|||
@Override | |||
public void close() throws IOException { |
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.
UnionInputGate looks like something core Flink specific, some artificial abstraction, not related to ShuffleService.
At the moment, it is virtual and does not have real resources behind.
I would not even call it InputGate from shuffle service perspective, it is rather a partial decorator.
The real gates are managed by Task, one level down of abstraction.
Although, this close implementation looks logical, currently, it is not used.
My concern is that if we leave it, it might confuse in future: somebody might start calling it and break the lifecycle of real gates managed only by Task atm. As it is just a refactoring, I would leave this close method empty then, because it looks like it is not supposed to be used anyways.
or you think, there is another reason to have it like this?
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.
Yes, I totally agree with you above points. Thanks for kindly reminder!
@azagrebin , thanks for the reviews! I agree with you above comments and submit a fixup commit for addressing it. |
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.
Thanks for addressing the comment @zhijiangW ! LGTM 👍
What is the purpose of the change
This is a sub-task for refactoring the interface of
InputGate
which would be created byShuffleService
future. So it is reasonable to reference with generalInputGate
anywhere instead of specificSingleInputGate
.To make
InputGate
extendAutoCloseable
interface, theTaskCanceler
could callInputGate#close
instead ofSingleInputGate#releaseAllResources
.Next we can further remove the reference with
SingleInputGate
in Task class by refactoring theupdatePartitionInfo
intoNetworkEnvironment
.Brief change log
InputGate
extendAutoCloseable
interfaceInputGate
inTaskCanceler
releaseAllResources
intoclose
inResultPartition
Verifying this change
This change is already covered by existing tests, such as SingleInputGateTest.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation