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


##########
solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java:
##########


Review Comment:
   The try-catch logic here is a challenge; not sure if we can make it 
elegant/clearer.



##########
solr/solrj/src/java/org/apache/solr/client/solrj/RequestNotSentException.java:
##########
@@ -0,0 +1,35 @@
+/*
+ * 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.client.solrj;
+
+import java.io.IOException;
+
+/**
+ * Indicates that a request failed before any of it was written to the 
network, so the server cannot
+ * have processed it. Retrying such a request on another node is safe even 
when it is not
+ * idempotent.
+ *
+ * <p>Typically a pooled connection that the server had already closed.
+ */
+public class RequestNotSentException extends IOException {
+
+  private static final long serialVersionUID = 1L;

Review Comment:
   Hmm; I should probably remove



##########
solr/solrj/src/test/org/apache/solr/client/solrj/impl/LBSolrClientRetryUnsentTest.java:
##########
@@ -0,0 +1,120 @@
+/*
+ * 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.client.solrj.impl;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.solr.SolrTestCase;
+import org.apache.solr.client.solrj.RequestNotSentException;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.SolrRequest;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.request.QueryRequest;
+import org.apache.solr.client.solrj.request.UpdateRequest;
+import org.apache.solr.common.util.NamedList;
+import org.junit.Test;
+
+/**
+ * A failure that proves the request never reached the server is safe to 
replay even when
+ * LBSolrClient would otherwise refuse to retry the request. {@link 
RequestNotSentException} is that
+ * proof.
+ */
+public class LBSolrClientRetryUnsentTest extends SolrTestCase {
+
+  private static final LBSolrClient.Endpoint FIRST =
+      new LBSolrClient.Endpoint("http://127.0.0.1:1/solr";);
+  private static final LBSolrClient.Endpoint SECOND =
+      new LBSolrClient.Endpoint("http://127.0.0.1:2/solr";);

Review Comment:
   I recall we have a test fixture/utility with bogus URLs we should use 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to