public void fail(RecoveryFailedException e,boolean sendShardFailure){
  if (finished.compareAndSet(false,true)) {
    try {
      listener.onRecoveryFailure(state(),e,sendShardFailure);
    }
  finally {
      try {
        cancellableThreads.cancel("failed recovery [" + e.getMessage() + "]");
      }
  finally {
        decRef();
      }
    }
  }
}

public void fail ( RecoveryFailedException e , boolean sendShardFailure ) { if ( finished . compareAndSet ( false , true ) ) { try { listener . onRecoveryFailure ( state ( ) , e , sendShardFailure ) ; } finally { try { cancellableThreads . cancel ( "failed recovery [" + e . getMessage ( ) + "]" ) ; } finally { decRef ( ) ; } } } }
fail the recovery and call listener
