code: private void finalizeRequest(Request request) {
          // Check, one last time, if the request was finalized. Better fail it with an AssertionError rather than leave it
          // hanging forever.
          if (!request.isDone()) {
              request.fail(new AssertionError("Request finalized but not yet completed."));
          }
  
          // Unregister the request.
          synchronized (this.lock) {
              this.pendingRequests.remove(request.getOffset());
          }
  
          log.debug("{}: StorageRead.Finalize {}, Success = {}", this.traceObjectId, request, !request.resultFuture.isCompletedExceptionally());
      }
docs: Ensures that the given request has been finalized (if not, it is failed), and unregisters it from the pending reads.
  
  @param request The request.