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/06/09 18:47:24 UTC

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

ivakegg commented on a change in pull request #1487:
URL: https://github.com/apache/accumulo/pull/1487#discussion_r437644023



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/ThriftClientHandler.java
##########
@@ -668,15 +669,27 @@ private void setUpdateTablet(UpdateSession us, KeyExtent keyExtent) {
 
   @Override
   public void applyUpdates(TInfo tinfo, long updateID, TKeyExtent tkeyExtent,
-      List<TMutation> tmutations) {
+      List<TMutation> tmutations) throws TException {
     UpdateSession us = (UpdateSession) server.sessionManager.reserveSession(updateID);
     if (us == null) {
       return;
     }
 
+    Semaphore semaphoreCopy = null;
     boolean reserved = true;
+
     try {
       KeyExtent keyExtent = new KeyExtent(tkeyExtent);
+
+      if (TabletType.type(keyExtent) == TabletType.USER) {
+        semaphoreCopy = server.getSemaphore();
+        if (!semaphoreCopy.tryAcquire()) {
+          throw new TException("Mutation failed. No threads available.");
+        } else {
+          log.info("Available permits: {}", semaphoreCopy.availablePermits());

Review comment:
       This will get logged at ever mutation.  Perhaps this should be a log.trace instead.




----------------------------------------------------------------
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