@Override
  public void resignLeadership() {
    if (isLeader.get()) {
      leaseBlobManager.releaseLease(leaseId.get());
      isLeader.set(false);
      LOG.info("Resigning leadership with lease ID {}", leaseId.get());
      leaseId.getAndSet(null);
    } else {
      LOG.info("Can't release the lease because it is not the leader and does not hold an active lease.");
    }
  }
Releases the lease in order to resign leadership. It also stops all schedulers scheduled by the leader.
The releaseLease operation has a retry policy where upon failure, the operation is tried 3 times at 5 second intervals.
samza-azure/src/main/java/org/apache/samza/coordinator/AzureLeaderElector.java