docs: @Nonnull
  	private CompletableFuture<AllocatedSlot> requestNewAllocatedSlotInternal(
  		@Nonnull SlotRequestId slotRequestId,
  		@Nonnull ResourceProfile resourceProfile,
  		@Nonnull Time timeout) {
  
  		componentMainThreadExecutor.assertRunningInMainThread();
  
  		final PendingRequest pendingRequest = new PendingRequest(
  			slotRequestId,
  			resourceProfile);
  
  		// register request timeout
  		FutureUtils
  			.orTimeout(
  				pendingRequest.getAllocatedSlotFuture(),
  				timeout.toMilliseconds(),
  				TimeUnit.MILLISECONDS,
  				componentMainThreadExecutor)
  			.whenComplete(
  				(AllocatedSlot ignored, Throwable throwable) -> {
  					if (throwable instanceof TimeoutException) {
  						timeoutPendingSlotRequest(slotRequestId);
  					}
  				});
  
  		if (resourceManagerGateway == null) {
  			stashRequestWaitingForResourceManager(pendingRequest);
  		} else {
  			requestSlotFromResourceManager(resourceManagerGateway, pendingRequest);
  		}
  
  		return pendingRequest.getAllocatedSlotFuture();
  	}