Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/10705#discussion_r53722164
--- Diff:
core/src/main/scala/org/apache/spark/broadcast/TorrentBroadcast.scala ---
@@ -179,8 +198,13 @@ private[spark] class TorrentBroadcast[T:
ClassTag](obj: T, id: Long)
blocks, SparkEnv.get.serializer, compressionCodec)
// Store the merged copy in BlockManager so other tasks on this
executor don't
// need to re-fetch it.
- SparkEnv.get.blockManager.putSingle(
- broadcastId, obj, StorageLevel.MEMORY_AND_DISK, tellMaster =
false)
+ blockManager.putSingle(broadcastId, obj,
StorageLevel.MEMORY_AND_DISK, tellMaster = false)
+ Option(TaskContext.get()) match {
+ case Some(taskContext) =>
+ taskContext.addTaskCompletionListener(_ =>
blockManager.releaseLock(broadcastId))
+ case None =>
+ blockManager.releaseLock(broadcastId)
--- End diff --
in this case we're just putting a block. Why not just always release the
block right after the put (if the put is successful)? I don't see any reason to
wait until the end of the task.
---
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]