code: private RetryingRegistration<F, G, S> createNewRegistration() {
  		RetryingRegistration<F, G, S> newRegistration = checkNotNull(generateRegistration());
  
  		CompletableFuture<Tuple2<G, S>> future = newRegistration.getFuture();
  
  		future.whenCompleteAsync(
  			(Tuple2<G, S> result, Throwable failure) -> {
  				if (failure != null) {
  					if (failure instanceof CancellationException) {
  						// we ignore cancellation exceptions because they originate from cancelling
  						// the RetryingRegistration
  						log.debug("Retrying registration towards {} was cancelled.", targetAddress);
  					} else {
  						// this future should only ever fail if there is a bug, not if the registration is declined
  						onRegistrationFailure(failure);
  					}
  				} else {
  					targetGateway = result.f0;
  					onRegistrationSuccess(result.f1);
  				}
  			}, executor);
  
  		return newRegistration;
  	}
docs: ------------------------------------------------------------------------