title: When can JVM (or OS) close the file handler abnormally?
body: <p>My application is running on top of Apache Hama which is distributed computing framework implemented in java.</p>
  
  <p>Multiple servers can issue the data pulling requests to the multiple machines. I use RPC in hadoop to make it server/client model.</p>
  
  <p>When a machine receives data pulling request, it then opens the file and </p>
  
  <p>I encountered the following error:</p>
  
  <pre><code>ERROR org.apache.hama.XXX:java.nio.channels.ClosedByInterruptException
      at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
      at sun.nio.ch.FileChannelImpl.size(FileChannelImpl.java:315)
      at org.apache.hama.FileHandler.openHandler(XXX.java:235)
      ...
      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:508)
      at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:959)
  </code></pre>
  
  <p>I use <strong>RandomAccessFile</strong> class to handle the very large file from a few GB to a few tens of GB.
  The error message says the file handler is closed by the interruption. But it does not say exactly why.</p>
  
  <p>The application code does not have any line of code that interrupts a certain threads. I suspect JVM or OS is invoking interuppt.</p>
  
  <p>When can JVM (or OS) close the file handler abnormally?</p>