private long doUninterruptibly(FileOperation op) throws IOException {
      boolean interrupted = false;
      try {
        synchronized (UninterruptibleRandomAccessFile.this) {
          while (true) {
            interrupted |= Thread.interrupted();
            FileChannel d = delegate();
            long lastPosition = getFilePointer();
            try {
              return op.doOp(d);
            } catch (ClosedByInterruptException e) {
              interrupted = true;
              reopen(lastPosition);
            }
          }
        }
      } finally {
        if (interrupted) {
          Thread.currentThread().interrupt();
        }
      }
    }
Perform an operation on the file, reopening the file and redoing the operation if necessary
if we are interrupted in the middle of the operation
geode-core/src/main/java/org/apache/geode/internal/cache/persistence/UninterruptibleRandomAccessFile.java