private Future<Void> closeAndReleaseParent(Channel parentChannel, Throwable cause, Promise<Void> resultPromise) {
    if (parentChannel.parent() != null) {
      // This isn't a parent channel. Notify it that something is wrong.
      Exception exception = new IOException(
          "Channel (" + parentChannel + ") is not a parent channel. It will be closed, "
              + "but cannot be released within this pool.");
      log.error(exception.getMessage());
      parentChannel.close();
      return resultPromise.setFailure(exception);
    }

    MultiplexedChannelRecord multiplexedChannel = parentChannel.attr(MULTIPLEXED_CHANNEL).get();

    // We may not have a multiplexed channel if the parent channel hasn't been fully initialized.
    if (multiplexedChannel != null) {
      if (cause == null) {
        multiplexedChannel.closeChildChannels();
      } else {
        multiplexedChannel.closeChildChannels(cause);
      }
      parentConnections.remove(multiplexedChannel);
    }

    parentChannel.close();
    if (parentChannel.attr(PARENT_CHANNEL_RELEASED).getAndSet(Boolean.TRUE) == null) {
      return parentConnectionPool.release(parentChannel, resultPromise);
    }

    return resultPromise.setSuccess(null);
  }
Acquire a stream on a connection that has already been initialized. This will return false if the connection cannot have
any more streams allocated, and true if the stream can be allocated.

This will NEVER complete the provided future when the return value is false. This will ALWAYS complete the provided
future when the return value is true.
ambry-network/src/main/java/com/github/ambry/network/http2/Http2MultiplexedChannelPool.java