-
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-35047][state] Shutdown StateExecutors when ForStKeyedStateBackend is closed #24768
Conversation
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.
LGTM
return; | ||
} | ||
disposed = true; | ||
for (StateExecutor executor : managedStateExecutors) { |
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.
Can this for-loop
be placed outside the lock?
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.
Based on the current implementation, it is indeed doable. However, I think that enclosing both disposed
and managedStateExecutors
within the protective scope of the lock
constitutes a more safe practice. Additionally, the chance of a lock conflict between createStateExecutor()
and dispose()
is very minimal, so the impact in this place is virtually imperceptible.
So I prefer to put this for-loop
of managedStateExecutors
inside the lock
scope.
WDYT?
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 the PR, PTAL my comment.
...nk-statebackend-forst/src/main/java/org/apache/flink/state/forst/ForStKeyedStateBackend.java
Show resolved
Hide resolved
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.
I think we'd better note the shutdown
contract down into the description/Javadoc of StateExecutor
. The StateExecutor
is managed by KeyedStateBackend
and the AEC
or operators won't take care of the lifecycle of it.
13f8dde
to
e88c4bd
Compare
@Zakelly Thanks for your suggestion. I have refined the JavaDoc in |
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.
LGTM
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 the update.
LGTM.
What is the purpose of the change
This pull request shuts down the ForStStateExecutors when ForStKeyedStateBackend is disposed.
Brief change log
Verifying this change
This change is already covered by existing tests, such as ForStStateBackendConfigTest and AsyncExecutionControllerTest.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation