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

    https://github.com/apache/spark/pull/19404#discussion_r183482802
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/CompactibleFileStreamLog.scala
 ---
    @@ -139,6 +139,9 @@ abstract class CompactibleFileStreamLog[T <: AnyRef : 
ClassTag](
           out.write('\n')
           out.write(Serialization.write(data).getBytes(UTF_8))
         }
    +    if (out.isInstanceOf[FSDataOutputStream]) {
    +      out.asInstanceOf[FSDataOutputStream].hflush
    +    }
    --- End diff --
    
    Something like 
    
    When opening stream
    ```scala
    var syncable: Option[Syncable]] = if (out.isInstanceOf[FSDataOutputStream]) 
Some(out.asInstanceOf[FSDataOutputStream]) else None
    ```
    
    then when at flush time, any flush failure just downgrades to a "don't 
flush any more"
    
    ```scala
    try {
    syncable.map(_.hflush)
    } catch {
    case _: Exception =>  syncable = None
    }
    ```
    
    I know, risky,  but I'm not 100% sure that its always 
UnsupportedOperationException which gets raised. If IO is failing, it'll 
surface later on anyway.


---

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

Reply via email to