Skip to content

Commit 00b402e

Browse files
committed
Initialize eagerly to fix a failing test
1 parent ba55d20 commit 00b402e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private[spark] class KryoSerializerInstance(ks: KryoSerializer) extends Serializ
209209
* pool of size one. SerializerInstances are not thread-safe, hence accesses to this field are
210210
* not synchronized.
211211
*/
212-
@Nullable private[this] var cachedKryo: Kryo = null
212+
@Nullable private[this] var cachedKryo: Kryo = borrowKryo()
213213

214214
/**
215215
* Borrows a [[Kryo]] instance. If possible, this tries to re-use a cached Kryo instance;

0 commit comments

Comments
 (0)