Github user patrickbrownsync commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22855#discussion_r232375758
  
    --- Diff: 
core/src/main/scala/org/apache/spark/serializer/KryoSerializer.scala ---
    @@ -101,13 +101,29 @@ class KryoSerializer(conf: SparkConf)
         }
       }
     
    -  @transient
    -  var pool: KryoPool = getPool
    +  private class PoolWrapper extends KryoPool {
    +    private var pool: KryoPool = getPool
    +
    +    override def borrow(): Kryo = pool.borrow()
    +
    +    override def release(kryo: Kryo): Unit = pool.release(kryo)
    +
    +    override def run[T](kryoCallback: KryoCallback[T]): T = 
pool.run(kryoCallback)
    +
    +    def reset(): Unit = {
    +      pool = getPool
    --- End diff --
    
    The KryoPool interface exposes no way to free it, so I believe that is not 
necessary


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to