psavalle commented on code in PR #56516:
URL: https://github.com/apache/spark/pull/56516#discussion_r3873037262
##########
core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:
##########
@@ -853,17 +853,10 @@ private[spark] class DAGScheduler(
val startResourceProfile = stageResourceProfiles.head
val mergedProfile = stageResourceProfiles.drop(1)
.foldLeft(startResourceProfile)((a, b) => mergeResourceProfiles(a,
b))
- // compared merged profile with existing ones so we don't add it over
and over again
- // if the user runs the same operation multiple times
- val resProfile =
sc.resourceProfileManager.getEquivalentProfile(mergedProfile)
- resProfile match {
- case Some(existingRp) => existingRp
- case None =>
- // this ResourceProfile could be different if it was merged so we
have to add it to
- // our ResourceProfileManager
- sc.resourceProfileManager.addResourceProfile(mergedProfile)
- mergedProfile
- }
+ // compare the merged profile with existing ones so we don't add it
over and over again
+ // if the user runs the same operation multiple times. The merged
ResourceProfile could
+ // be different from any existing one, in which case it is registered
here.
+ sc.resourceProfileManager.getOrAddEquivalentProfile(mergedProfile)
Review Comment:
Nice find, I've added a check and a test for this particular case
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]