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/14 03:08:53 UTC

[lucene-solr] branch reference_impl_dev updated: @829 Fix to always notify http2solrclient asynctracker complete callback after user callback is done.

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


The following commit(s) were added to refs/heads/reference_impl_dev by this push:
     new 38b6808  @829 Fix to always notify http2solrclient asynctracker complete callback after user callback is done.
38b6808 is described below

commit 38b68085c8cabe0d1373269feae73886c7bbc48e
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Sun Sep 13 22:08:30 2020 -0500

    @829 Fix to always notify http2solrclient asynctracker complete callback after user callback is done.
---
 .../src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java   | 4 ++--
 .../solr/client/solrj/impl/CloudHttp2SolrClientWireMockTest.java      | 3 +--
 2 files changed, 3 insertions(+), 4 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 f84e0f7..82fbc7a 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
@@ -410,8 +410,6 @@ public class Http2SolrClient extends SolrClient {
 
           @Override
           public void onComplete(Result result) {
-            asyncTracker.completeListener.onComplete(result);
-
             if (result.isFailed()) {
               onComplete.onFailure(result.getFailure());
               return;
@@ -425,6 +423,8 @@ public class Http2SolrClient extends SolrClient {
             } catch (Exception e) {
               ParWork.propagateInterrupt(e);
               onComplete.onFailure(e);
+            } finally {
+              asyncTracker.completeListener.onComplete(result);
             }
 
           }
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientWireMockTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientWireMockTest.java
index a3fb7f1..5182a9f 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientWireMockTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientWireMockTest.java
@@ -43,7 +43,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.post;
 import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
 import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
 
-@Ignore // nocommit: random fails due to url
+@Ignore // nocommit can get a bad url, perhaps the random solr context that is generated is not compat
 public class CloudHttp2SolrClientWireMockTest extends BaseSolrClientWireMockTest {
 
   @Test
@@ -124,7 +124,6 @@ public class CloudHttp2SolrClientWireMockTest extends BaseSolrClientWireMockTest
 
   @SuppressWarnings({"rawtypes", "unchecked"})
   @Test
-  @Ignore // nocommit parallel updates does not populate route responses
   public void testParallelUpdates() throws Exception {
     // expect update requests go to both shards
     stubFor(post(urlPathEqualTo(SHARD1_PATH+"/update"))