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

    https://github.com/apache/spark/pull/20673#discussion_r170477999
  
    --- Diff: core/src/main/scala/org/apache/spark/util/JsonProtocol.scala ---
    @@ -100,7 +102,16 @@ private[spark] object JsonProtocol {
             executorMetricsUpdateToJson(metricsUpdate)
           case blockUpdate: SparkListenerBlockUpdated =>
             blockUpdateToJson(blockUpdate)
    -      case _ => parse(mapper.writeValueAsString(event))
    +      case _ =>
    +        val outputStream = new PipedOutputStream()
    +        val inputStream = new PipedInputStream(outputStream)
    +        try {
    +          mapper.writeValue(outputStream, event)
    +          parse(inputStream)
    +        } finally {
    +          IOUtils.closeQuietly(outputStream)
    --- End diff --
    
    and .. another note for  `IOUtils.closeQuietly` saying that it's 
intentionally used in case that the close might be already attempted by 
Jackson's library if I understood correctly?


---

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

Reply via email to