code: private void abort(Error error) {
      try {
        if (mContext == null || mContext.getError() != null || mContext.isDoneUnsafe()) {
          // Note, we may reach here via events due to network errors bubbling up before
          // mContext is initialized, or stream error after the request is finished.
          return;
        }
        mContext.setError(error);
        cleanupRequest(mContext);
        replyError();
      } catch (Exception e) {
        LOG.warn("Failed to cleanup states with error {}.", e.getMessage());
      }
    }
docs: Abort the write process due to error.
  
  @param error the error