Skip to content

Commit e678b9f

Browse files
shivaramJoshRosen
authored andcommitted
[SPARK-3973] Print call site information for broadcasts
Its hard to debug which broadcast variables refer to what in a big codebase. Printing call site information helps in debugging. Author: Shivaram Venkataraman <[email protected]> Closes #2829 from shivaram/spark-broadcast-print and squashes the following commits: cd6dbdf [Shivaram Venkataraman] Print call site information for broadcasts
1 parent dedace8 commit e678b9f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/main/scala/org/apache/spark/SparkContext.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,8 @@ class SparkContext(config: SparkConf) extends Logging {
818818
*/
819819
def broadcast[T: ClassTag](value: T): Broadcast[T] = {
820820
val bc = env.broadcastManager.newBroadcast[T](value, isLocal)
821+
val callSite = getCallSite
822+
logInfo("Created broadcast " + bc.id + " from " + callSite.shortForm)
821823
cleaner.foreach(_.registerBroadcastForCleanup(bc))
822824
bc
823825
}

0 commit comments

Comments
 (0)