From d791409f1be805ae24ea2db73ccce6dc795eca51 Mon Sep 17 00:00:00 2001 From: Ruifeng Zheng Date: Fri, 11 Oct 2024 10:14:30 +0800 Subject: [PATCH] address comments --- core/src/main/scala/org/apache/spark/util/Lazy.scala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/main/scala/org/apache/spark/util/Lazy.scala b/core/src/main/scala/org/apache/spark/util/Lazy.scala index fa1dc207a184e..0e2d2626f61f8 100644 --- a/core/src/main/scala/org/apache/spark/util/Lazy.scala +++ b/core/src/main/scala/org/apache/spark/util/Lazy.scala @@ -24,6 +24,13 @@ package org.apache.spark.util * (in our case, this was the logger). This causes scala to also try to grab a coarse lock on * the parent object. * c) If thread 1 waits for thread 2 to join, a deadlock occurs. + * The main difference between this and [[LazyTry]] is that this does not cache failures. + * + * @note + * Scala 3 uses a different implementation of lazy vals which doesn't have this problem. + * Please refer to Lazy + * Vals Initialization for more details. */ private[spark] class Lazy[T](initializer: => T) extends Serializable {