title: Spark Exception in windows: java.io.IOException: fail to rename shuffle file
body: <p>I am facing an issue when trying to run a piece of Spark Streaming code. I am trying to read data from a kafka topic and then pushing the processed data to elastic search. I am running this code in eclipse on windows and have configured Kafka, Spark, zookeeper and elasticsearch. I am getting the following error:</p>
  
  <pre><code>  18/02/20 14:52:11 ERROR Executor: Exception in task 0.0 in stage 6.0 (TID 5)
    java.io.IOException: fail to rename file C:\Users\shash\AppData\Local\Temp\blockmgr-cb45497b-7f85-4158-815b-852edecbb2c5\0f\shuffle_1_0_0.index.ca3b55d2-6c26-4798-a17b-21a42f099126 to C:\Users\shash\AppData\Local\Temp\blockmgr-cb45497b-7f85-4158-815b-852edecbb2c5\0f\shuffle_1_0_0.index
  at org.apache.spark.shuffle.IndexShuffleBlockResolver.writeIndexFileAndCommit(IndexShuffleBlockResolver.scala:178)
  at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:72)
  at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:79)
  at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:47)
  at org.apache.spark.scheduler.Task.run(Task.scala:85)
  at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:274)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    18/02/20 14:52:11 WARN TaskSetManager: Lost task 0.0 in stage 6.0 (TID 5, localhost): java.io.IOException: fail to rename file C:\Users\shash\AppData\Local\Temp\blockmgr-cb45497b-7f85-4158-815b-852edecbb2c5\0f\shuffle_1_0_0.index.ca3b55d2-6c26-4798-a17b-21a42f099126 to C:\Users\shash\AppData\Local\Temp\blockmgr-cb45497b-7f85-4158-815b-852edecbb2c5\0f\shuffle_1_0_0.index
  at org.apache.spark.shuffle.IndexShuffleBlockResolver.writeIndexFileAndCommit(IndexShuffleBlockResolver.scala:178)
  at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:72)
  at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:79)
  at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:47)
  at org.apache.spark.scheduler.Task.run(Task.scala:85)
  at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:274)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>Can someone give me some inputs on how to resolve this issue? </p>