@Override
  public Future<Void> release(Channel childChannel, Promise<Void> promise) {
    if (childChannel.parent() == null) {
      // This isn't a child channel. Oddly enough, this is "expected" and is handled properly by the
      // BetterFixedChannelPool AS LONG AS we return an IllegalArgumentException via the promise.
      closeAndReleaseParent(childChannel);
      return promise.setFailure(new IllegalArgumentException("Channel (" + childChannel + ") is not a child channel."));
    }

    Channel parentChannel = childChannel.parent();
    MultiplexedChannelRecord multiplexedChannel = parentChannel.attr(MULTIPLEXED_CHANNEL).get();
    if (multiplexedChannel == null) {
      // This is a child channel, but there is no attached multiplexed channel, which there should be if it was from
      // this pool. Close it and log an error.
      Exception exception = new IOException(
          "Channel (" + childChannel + ") is not associated with any channel records. "
              + "It will be closed, but cannot be released within this pool.");
      log.error(exception.getMessage());
      childChannel.close();
      return promise.setFailure(exception);
    }

    multiplexedChannel.closeAndReleaseChild(childChannel);

    if (multiplexedChannel.canBeClosedAndReleased()) {
      log.debug("Parent channel closed: {}", parentChannel.remoteAddress());
      // We just closed the last stream in a connection that has reached the end of its life.
      return closeAndReleaseParent(parentChannel, null, promise);
    }

    return promise.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