You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/04/07 14:46:35 UTC

[GitHub] [accumulo] keith-turner commented on a change in pull request #1487: Fixes: #1323 Implement a write thread limit

keith-turner commented on a change in pull request #1487: Fixes: #1323 Implement a write thread limit
URL: https://github.com/apache/accumulo/pull/1487#discussion_r404865789
 
 

 ##########
 File path: server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
 ##########
 @@ -1011,19 +1030,33 @@ private void setUpdateTablet(UpdateSession us, KeyExtent keyExtent) {
         updateMetrics.addPermissionErrors(0);
         return;
       }
+
     }
 
     @Override
     public void applyUpdates(TInfo tinfo, long updateID, TKeyExtent tkeyExtent,
-        List<TMutation> tmutations) {
+        List<TMutation> tmutations) throws TException {
       UpdateSession us = (UpdateSession) sessionManager.reserveSession(updateID);
       if (us == null) {
         return;
       }
 
+      Semaphore semaphoreCopy = getSemaphore();
       boolean reserved = true;
+      boolean semaphoreAcquired = false;
       try {
         KeyExtent keyExtent = new KeyExtent(tkeyExtent);
+
+        if (TabletType.type(keyExtent) == TabletType.USER) {
+          if (!semaphoreCopy.tryAcquire()) {
+            throw new TException("Mutation failed. No threads available.");
 
 Review comment:
   We could consider having a specialized thrift exception that is thrown to indicate resource exhaustion on tserver.  When the batch writer sees this it could retry with exponential backoff up to its configured time-out.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services