code: protected void endRequest() {
          int oldState, newState;
          do {
              oldState = state;
              newState = oldState - 1;
          } while (!stateUpdater.compareAndSet(this, oldState, newState));
          if (newState == CLOSED) {
              handleCompleted();
          }
      }
docs: End a request and call the {@link #handleCompleted()} if the server is
  shutdown and there are no more active requests.