-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-18372][runtime] Fix NPE problem when a slot is offered before JM is connected to a RM #12732
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-18372][runtime] Fix NPE problem when a slot is offered before JM is connected to a RM #12732
Conversation
|
@azagrebin @tillrohrmann would you take a look at this fix when convenient? |
|
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 8e28cd7 (Sun Jun 21 09:00:30 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. DetailsThe 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:
|
8e28cd7 to
e7777af
Compare
tillrohrmann
left a comment
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 creating this PR @zhuzhurk. The changes look good to me. I had a comment concerning querying pendingRequests which might have resulted from wrong assumptions about the internal state of the component.
| maybeRemapOrphanedAllocation(allocationIdOfRequest, allocatedSlot.getAllocationId()); | ||
| // the allocation id can be null if the request was fulfilled by a slot directly offered | ||
| // by a reconnected TaskExecutor before the ResourceManager is connected | ||
| if (allocationIdOfRequest != null) { |
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 you could directly ask pendingRequest.getAllocationId(). That way you would not need to query pendingRequests again.
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.
Moreover, there is no invariant which states that pendingRequests contains the mapping. Hence, it would also make sense to directly ask pendingRequest here.
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.
Agreed. done.
…JM is connected to a RM
16edfbe to
922cafd
Compare
What is the purpose of the change
This PR is to fix the NPE problem which can happen when a slot is offered before JM is connected to a RM.
Brief change log
See the commit.
Verifying this change
Does this pull request potentially affect one of the following parts:
@Public(Evolving): (yes / no)Documentation