Skip to content

Conversation

@LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Aug 5, 2022

What changes were proposed in this pull request?

This pr use try-with-resource to ensure DBIterator is close after use in RemoteBlockPushResolver, YarnShuffleService and ExternalShuffleBlockResolver to avoid resource leakage.

Why are the changes needed?

Avoid DBIterator resource leakage.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Pass GitHub Actions

@github-actions github-actions bot added the CORE label Aug 5, 2022
@LuciferYang LuciferYang changed the title [SPARK-39988][CORE][YARN] Add try-with-resource to ensure DBIterator is close after use in RemoteBlockPushResolver, YarnShuffleService and ExternalShuffleBlockResolver [SPARK-39988][CORE] Add try-with-resource to ensure DBIterator is close after use in RemoteBlockPushResolver, YarnShuffleService and ExternalShuffleBlockResolver Aug 5, 2022
@LuciferYang LuciferYang changed the title [SPARK-39988][CORE] Add try-with-resource to ensure DBIterator is close after use in RemoteBlockPushResolver, YarnShuffleService and ExternalShuffleBlockResolver [SPARK-39988][CORE] Use try-with-resource to ensure DBIterator is close after use in RemoteBlockPushResolver, YarnShuffleService and ExternalShuffleBlockResolver Aug 5, 2022
throws IOException {
ConcurrentMap<AppExecId, ExecutorShuffleInfo> registeredExecutors = Maps.newConcurrentMap();
if (db != null) {
DBIterator itr = db.iterator();
Copy link
Contributor Author

@LuciferYang LuciferYang Aug 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The methods reloadActiveAppAttemptsPathInfo and reloadFinalizedAppAttemptsShuffleMergeInfo should be Spark 3.4 only. Please let me know if this PR needs to be backport to other branch

@LuciferYang
Copy link
Contributor Author

cc @dongjoon-hyun @mridulm Changes of this pr is for bug fix, which is not within the refactor scope of SPARK-38909

@LuciferYang LuciferYang changed the title [SPARK-39988][CORE] Use try-with-resource to ensure DBIterator is close after use in RemoteBlockPushResolver, YarnShuffleService and ExternalShuffleBlockResolver [SPARK-39988][CORE] Use try-with-resource to ensure DBIterator is close after use Aug 5, 2022
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, but we had better ping more people in this area, @LuciferYang .

Copy link
Contributor

@mridulm mridulm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@dongjoon-hyun
Copy link
Member

Merged to master.

@LuciferYang
Copy link
Contributor Author

LuciferYang commented Aug 8, 2022

Looks reasonable to me, but we had better ping more people in this area, @LuciferYang .

Sorry for not reply at the weekend, this issue exists in the historical version, do we need a backport?

@dongjoon-hyun
Copy link
Member

No, I don't think so for now, @LuciferYang . Let's keep this in master branch for Apache Spark 3.4.0 first.

@LuciferYang
Copy link
Contributor Author

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants