private void onResponseComplete(RestRequest restRequest, RestResponseChannel restResponseChannel,
      ReadableStreamChannel response, Exception exception) {
    try {
      if (exception != null) {
        metrics.responseExceptionCount.inc();
      }
      restRequest.getMetricsTracker().scalingMetricsTracker.markRequestCompleted();
      restResponseChannel.onResponseComplete(exception);
      metrics.responseCompletionRate.mark();
    } catch (Exception e) {
      metrics.responseCompleteTasksError.inc();
      logger.error("Error during response complete tasks", e);
    } finally {
      logger.trace("Response complete for request {}", restRequest.getUri());
      releaseResources(restRequest, response);
    }
  }
Completes the response.
@param restRequest the {@link RestRequest} for which the response has been constructed.
@param restResponseChannel the {@link RestResponseChannel} to be used to send the response.
@param response a {@link ReadableStreamChannel} that represents the response to the {@code restRequest}.
@param exception if the response could not be constructed, the reason for the failure.
ambry-rest/src/main/java/com/github/ambry/rest/AsyncRequestResponseHandler.java