code: private void sendStatusAndClose(final Channel chan, final HttpResponseStatus status) {
      if (chan.isConnected()) {
        final DefaultHttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, status);
        final ChannelFuture future = chan.write(response);
        future.addListener(ChannelFutureListener.CLOSE);
      }
    }
docs: Helper method for sending a status-only HTTP response.  This is used in cases where
  {@link #createQueryInstance(TSDB, HttpRequest, Channel)} failed to determine a query
  and we still want to return an error status to the client.