You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2020/02/20 12:55:39 UTC

[lucene-solr] branch branch_8x updated (ac46213 -> d5e51bf)

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

shalin pushed a change to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


    from ac46213  LUCENE-8707: fix test bug. when bounding box if a triangle is within a circle, the triangle is within the circle as well.
     new 8eb6b03  SOLR-12550: ConcurrentUpdateSolrClient doesn't respect timeouts for commits and optimize (#417)
     new d5e51bf  SOLR-12550: Adding entry to CHANGES.txt

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 solr/CHANGES.txt                                   |  3 +++
 .../solrj/impl/ConcurrentUpdateSolrClient.java     |  2 ++
 .../ConcurrentUpdateSolrClientBuilderTest.java     | 29 ++++++++++++++++++++++
 3 files changed, 34 insertions(+)


[lucene-solr] 01/02: SOLR-12550: ConcurrentUpdateSolrClient doesn't respect timeouts for commits and optimize (#417)

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8eb6b03d51c005448f0f046a20eed07039e14606
Author: Marc A. Morissette <ma...@gmail.com>
AuthorDate: Thu Feb 20 07:29:20 2020 -0500

    SOLR-12550: ConcurrentUpdateSolrClient doesn't respect timeouts for commits and optimize (#417)
    
    ConcurrentUpdateSolrClient now propagates its connection and read timeouts to the private HttpSolrClient used to commit and optimize.
    
    (cherry picked from commit 051133c13f982e72aabf914350c65e3dd8aa961d)
---
 .../solrj/impl/ConcurrentUpdateSolrClient.java     |  2 ++
 .../ConcurrentUpdateSolrClientBuilderTest.java     | 29 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
index edc8270..c774e03 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java
@@ -125,6 +125,8 @@ public class ConcurrentUpdateSolrClient extends SolrClient {
     this.internalHttpClient = (builder.httpClient == null);
     this.client = new HttpSolrClient.Builder(builder.baseSolrUrl)
         .withHttpClient(builder.httpClient)
+        .withConnectionTimeout(builder.connectionTimeoutMillis)
+        .withSocketTimeout(builder.socketTimeoutMillis)
         .build();
     this.client.setFollowRedirects(false);
     this.queue = new LinkedBlockingQueue<>(builder.queueSize);
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientBuilderTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientBuilderTest.java
index af120fc..282b88d 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientBuilderTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientBuilderTest.java
@@ -17,7 +17,13 @@
 
 package org.apache.solr.client.solrj.impl;
 
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.SocketTimeoutException;
+
 import org.apache.solr.SolrTestCase;
+import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient.Builder;
 import org.junit.Test;
 
@@ -39,4 +45,27 @@ public class ConcurrentUpdateSolrClientBuilderTest extends SolrTestCase {
       // is the baseSolrUrl
     }
   }
+
+  /**
+   * Test that connection timeout information is passed to the HttpSolrClient that handles non add operations.
+   */
+  @Test(timeout = 10000)
+  public void testSocketTimeoutOnCommit() throws IOException, SolrServerException {
+    InetAddress localHost = InetAddress.getLocalHost();
+    try (ServerSocket server = new ServerSocket(0, 1, localHost);
+         ConcurrentUpdateSolrClient client = new ConcurrentUpdateSolrClient.Builder(
+             "http://" + localHost.getHostAddress() + ":" + server.getLocalPort() + "/noOneThere")
+             .withSocketTimeout(1)
+             .build()){
+      // Expecting an exception
+      client.commit();
+      fail();
+    }
+    catch (SolrServerException e) {
+      if (!(e.getCause() instanceof SocketTimeoutException)) {
+        throw e;
+      }
+      // else test passses
+    }
+  }
 }


[lucene-solr] 02/02: SOLR-12550: Adding entry to CHANGES.txt

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d5e51bf9946b87ee1c0c7f4c082980c62b0b0631
Author: Shalin Shekhar Mangar <sh...@apache.org>
AuthorDate: Thu Feb 20 04:33:53 2020 -0800

    SOLR-12550: Adding entry to CHANGES.txt
    
    (cherry picked from commit 2fdd3b02bb02a63c7a5d7eba6f14189b0193e31b)
---
 solr/CHANGES.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index f078a0c..6b7f585 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -138,6 +138,9 @@ Bug Fixes
 * SOLR-13041: Add hashCode for autoscaling.Condition to accompany the already present equals.
   (Zsolt Gyulavari via Christine Poerschke)
 
+* SOLR-12550: ConcurrentUpdateSolrClient doesn't respect timeouts for commits and optimize.
+  (Marc A. Morissette, Bérénice MAUREL via shalin)
+
 Other Changes
 ---------------------