dsmiley commented on code in PR #1410:
URL: https://github.com/apache/solr/pull/1410#discussion_r1124950966


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java:
##########
@@ -1273,4 +1287,33 @@ static SslContextFactory.Client 
getDefaultSslContextFactory() {
 
     return sslContextFactory;
   }
+
+  private static class MDCCopyHelper extends RequestResponseListener {

Review Comment:
   Why implement RequestResponseListener?  



##########
solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java:
##########
@@ -469,6 +474,43 @@ public void testGetById() throws Exception {
     }
   }
 
+  @Test
+  public void testGetByIdArrayBlockingQueue() throws Exception {
+    DebugServlet.clear();
+
+    // client setup needs to be same as HttpShardHandlerFactory
+

Review Comment:
   ah..... okay, so you are seeing an existing problem.  I would have 
recommended modifying an existing distributed-search test.  Your new test is 
fine though.



##########
solr/core/src/test/org/apache/solr/handler/TestHttpRequestId.java:
##########
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.handler;
+
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import org.apache.solr.SolrJettyTestBase;
+import org.apache.solr.client.solrj.impl.Http2SolrClient;
+import 
org.apache.solr.client.solrj.impl.HttpListenerFactory.RequestResponseListener;
+import org.apache.solr.client.solrj.request.SolrPing;
+import org.apache.solr.client.solrj.util.AsyncListener;
+import org.apache.solr.common.util.ExecutorUtil;
+import org.apache.solr.common.util.NamedList;
+import org.apache.solr.common.util.SolrNamedThreadFactory;
+import org.eclipse.jetty.client.api.Request;
+import org.eclipse.jetty.client.api.Result;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.slf4j.MDC;
+
+public class TestHttpRequestId extends SolrJettyTestBase {

Review Comment:
   Your test approach is a bit invasive... uses the internals of Http2 client.  
It's okay but I was hoping you would have more of an integration test that like 
TestRequestId, which is why I referred you to that test.  It does not depend on 
internal details of SolrClients etc.  I love integration tests as it's more 
realistic, doesn't assume internals, and also makes it easier to change 
internals at some point.  Since I now understand you observed specifically an 
issue with distributed search because of HttpShardHandler's use of that, maybe 
you could even use a simple query that uses that under the hood?



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

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to