Github user bkrieger commented on a diff in the pull request: https://github.com/apache/spark/pull/22995#discussion_r236715555 --- Diff: core/src/main/scala/org/apache/spark/broadcast/TorrentBroadcast.scala --- @@ -92,8 +95,15 @@ private[spark] class TorrentBroadcast[T: ClassTag](obj: T, id: Long) /** The checksum for all the blocks. */ private var checksums: Array[Int] = _ - override protected def getValue() = { - _value + override protected def getValue() = synchronized { --- End diff -- I think we can remove the `TorrentBroadcast.synchronized` in `readBroadcastBlock`, since we're already synchronizing in its only caller? Though I'm not sure why it was necessary in the first place, as `readBroadcastBlock` should only have been called once before this PR. Regardless, I agree that the perf hit should be ok. Let me know if you want any of this changed.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org