@Override
    public boolean canGrantVote(ReplicaKey candidateKey, boolean isLogUpToDate) {
        log.debug(
            "Rejecting vote request from candidate ({}) since we have resigned as candidate/leader in epoch {}",
            candidateKey,
            epoch
        );

        return false;
    }
Check the time remaining until the timeout expires.

@param currentTimeMs current time in milliseconds
@return the duration in milliseconds from the current time before the timeout expires
raft/src/main/java/org/apache/kafka/raft/ResignedState.java