title: java.io.EOFException: Premature EOF: no length prefix available in Spark on Hadoop
body: <p>I'm getting this weird exception. I'm using Spark 1.6.0 on Hadoop 2.6.4 and submitting Spark job on YARN cluster. </p>
  
  <pre><code>16/07/23 20:05:21 WARN hdfs.DFSClient: DFSOutputStream ResponseProcessor exception  for block BP-532134798-128.110.152.143-1469321545728:blk_1073741865_1041
  java.io.EOFException: Premature EOF: no length prefix available
      at org.apache.hadoop.hdfs.protocolPB.PBHelper.vintPrefixed(PBHelper.java:2203)
      at org.apache.hadoop.hdfs.protocol.datatransfer.PipelineAck.readFields(PipelineAck.java:176)
      at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer$ResponseProcessor.run(DFSOutputStream.java:867)
  16/07/23 20:49:09 ERROR server.TransportRequestHandler: Error sending result RpcResponse{requestId=4719626006875125240, body=NioManagedBuffer{buf=java.nio.HeapByteBuffer[pos=0 lim=81 cap=81]}} to ms0440.utah.cloudlab.us/128.110.152.175:58944; closing connection
  java.nio.channels.ClosedChannelException
  </code></pre>
  
  <p>I was getting this error when running on Hadoop 2.6.0 and thought the exception might be kind of a bug like <a href="https://issues.apache.org/jira/browse/HDFS-8475" rel="noreferrer">this</a> but after even changing this to Hadoop 2.6.4 I'm getting the same error. There is not any memory problem, my cluster is good with HDFS and memory. I went through <a href="https://stackoverflow.com/questions/27483004/hadoop-while-running-my-program-following-message-displayed-what-does-it-mean">this</a> and <a href="https://stackoverflow.com/questions/21718900/exception-in-createblockoutputstream-when-copying-data-into-hdfs">this</a> but no luck. </p>
  
  <p>Note: 1. I'm using Apache Hadoop and Spark not any CDH/HDP. 2. I'm able to copy data in HDFS and even able to execute another job on this cluster. </p>