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

    https://github.com/apache/spark/pull/10705#discussion_r53681851
  
    --- Diff: 
core/src/main/scala/org/apache/spark/broadcast/TorrentBroadcast.scala ---
    @@ -90,22 +90,22 @@ private[spark] class TorrentBroadcast[T: ClassTag](obj: 
T, id: Long)
     
       /**
        * Divide the object into multiple blocks and put those blocks in the 
block manager.
    +   *
        * @param value the object to divide
        * @return number of blocks this broadcast variable is divided into
        */
       private def writeBlocks(value: T): Int = {
         // Store a copy of the broadcast variable in the driver so that tasks 
run on the driver
         // do not create a duplicate copy of the broadcast variable's value.
    -    SparkEnv.get.blockManager.putSingle(broadcastId, value, 
StorageLevel.MEMORY_AND_DISK,
    -      tellMaster = false)
    +    val blockManager = SparkEnv.get.blockManager
    +    blockManager.putSingle(broadcastId, value, 
StorageLevel.MEMORY_AND_DISK, tellMaster = false)
    +    blockManager.releaseLock(broadcastId)
    --- End diff --
    
    Actually what I should do is check the return code of `putSingle` and use 
that to decide whether to release the lock.


---
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