Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-27093

AsyncNonMetaRegionLocator:put Complete CompletableFuture outside lock block

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

       

      synchronized (tableCache) {
        tableCache.pendingRequests.remove(req);
        // fail the request itself, no matter whether it is a DoNotRetryIOException, as we have
        // already retried several times
        CompletableFuture<?> future = tableCache.allRequests.remove(req);
        if (future != null) {
          future.completeExceptionally(error);
        }
        tableCache.clearCompletedRequests(null);
        // Remove a complete locate request in a synchronized block, so the table cache must have
        // quota to send a candidate request.
        toSend = tableCache.getCandidate();
        toSend.ifPresent(r -> tableCache.send(r));
      }
      
      

      Complete or completeExceptionally in a lock block may cause deadlock. We can put this action outside the lock block to avoid deadlock.

       

      Attachments

        Issue Links

          Activity

            People

              xiaowangzhixiao zhiwang
              xiaowangzhixiao zhiwang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Remaining Estimate - 24h
                  24h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified