private void invokeResendCallBack(WireCommand wireCommand) { if (state.needSuccessors.compareAndSet(false, true)) { Retry.indefinitelyWithExpBackoff(retrySchedule.getInitialMillis(), retrySchedule.getMultiplier(), retrySchedule.getMaxDelay(), t -> log.error(writerId + " to invoke resendToSuccessors callback: ", t)) .runInExecutor(() -> { log.debug("Invoking resendToSuccessors call back for {} on writer {}", wireCommand, writerId); resendToSuccessorsCallback.accept(Segment.fromScopedName(getSegmentName())); }, connectionFactory.getInternalExecutor()) .thenRun(() -> { log.trace("Release inflight latch for writer {}", writerId); state.waitingInflight.release(); }); } }