Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7364#discussion_r34541643
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/Master.scala 
---
    @@ -727,40 +727,44 @@ private[master] class Master(
     
       def removeApplication(app: ApplicationInfo, state: 
ApplicationState.Value) {
         if (apps.contains(app)) {
    -      logInfo("Removing app " + app.id)
    -      apps -= app
    -      idToApp -= app.id
    -      endpointToApp -= app.driver
    -      addressToApp -= app.driver.address
    -      if (completedApps.size >= RETAINED_APPLICATIONS) {
    -        val toRemove = math.max(RETAINED_APPLICATIONS / 10, 1)
    -        completedApps.take(toRemove).foreach( a => {
    -          appIdToUI.remove(a.id).foreach { ui => webUi.detachSparkUI(ui) }
    -          applicationMetricsSystem.removeSource(a.appSource)
    -        })
    -        completedApps.trimStart(toRemove)
    -      }
    -      completedApps += app // Remember it in our history
    -      waitingApps -= app
    +      synchronized{
    --- End diff --
    
    It's a premature optimization -- why? 
    Also I don't think this really addresses the full problem, as there are 
other methods modifying the same state concurrently. I'd rather not commit 
something incomplete.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to