You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/09/17 15:22:35 UTC

[lucene-solr] 01/18: @836 Bring back max outstanding.

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit c79c0291b4cc2342a412136bf07049d506aaf44e
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Wed Sep 16 16:49:32 2020 -0500

    @836 Bring back max outstanding.
---
 .../solr/client/solrj/impl/Http2SolrClient.java    | 41 +++++++++++-----------
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
index 81863b9..79b861b 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java
@@ -859,17 +859,16 @@ public class Http2SolrClient extends SolrClient {
 
   public static class AsyncTracker {
 
-    // nocommit - look at outstanding max again
-    private static final int MAX_OUTSTANDING_REQUESTS = 30;
+    private static final int MAX_OUTSTANDING_REQUESTS = 100;
 
-    //private final Semaphore available;
+    private final Semaphore available;
 
     // wait for async requests
     private final Phaser phaser = new ThePhaser(1);
     // maximum outstanding requests left
 
     public AsyncTracker() {
-     // available = new Semaphore(MAX_OUTSTANDING_REQUESTS, true);
+      available = new Semaphore(MAX_OUTSTANDING_REQUESTS, true);
 
     }
 
@@ -895,32 +894,32 @@ public class Http2SolrClient extends SolrClient {
         log.debug("Registered new party {}", phaser);
       }
       phaser.register();
-//      try {
-//        available.acquire();
-//      } catch (InterruptedException e) {
-//        log.warn("interrupted", e);
-//      }
+      try {
+        available.acquire();
+      } catch (InterruptedException e) {
+        log.warn("interrupted", e);
+      }
     }
 
     public void arrive() {
-//      try {
-//        available.release();
-//      } finally {
+      try {
+        available.release();
+      } finally {
         phaser.arriveAndDeregister();
-    //  }
+      }
       if (log.isDebugEnabled()) log.debug("Request complete {}", phaser);
     }
+  }
 
-    private static class ThePhaser extends Phaser {
+  public static class ThePhaser extends Phaser {
 
-      ThePhaser(int start) {
-        super(start);
-      }
+    ThePhaser(int start) {
+      super(start);
+    }
 
-      @Override
-      protected boolean onAdvance(int phase, int parties) {
-        return false;
-      }
+    @Override
+    protected boolean onAdvance(int phase, int parties) {
+      return false;
     }
   }