private void terminateAndWaitFsyncService() throws Exception {
  if (fsyncService.isTerminated())   return;
  fsyncService.shutdown();
  fsyncService.awaitTermination(3600,TimeUnit.SECONDS);
  Exception fsyncExceptionCopy=fsyncException;
  if (fsyncExceptionCopy != null)   throw fsyncExceptionCopy;
}

private void terminateAndWaitFsyncService ( ) throws Exception { if ( fsyncService . isTerminated ( ) ) return ; fsyncService . shutdown ( ) ; fsyncService . awaitTermination ( 3600 , TimeUnit . SECONDS ) ; Exception fsyncExceptionCopy = fsyncException ; if ( fsyncExceptionCopy != null ) throw fsyncExceptionCopy ; }
terminate the fsync service and wait for all the tasks to complete . if it is already terminated
