jdyer1 commented on code in PR #2259:
URL: https://github.com/apache/solr/pull/2259#discussion_r1521446351


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrJdkClient.java:
##########
@@ -278,64 +285,74 @@ private HttpResponse<InputStream> doPutOrPost(
     return response;
   }
 
-  private volatile boolean headRequested;
-  private volatile boolean headSucceeded;
-
   /**
-   *  TODO: we should only try this if not set to Http/1.1 and not TLS
-   *
-   *
-   *  This is a workaround for the case where the first request using
-   *  this client:
+   * This is a workaround for the case where:
    *
-   *    (1) no SSL/TLS (2) using POST with stream and (3) using Http/2
+   * <p>(1) no SSL/TLS (2) using POST with stream and (3) using Http/2
    *
-   *    The JDK Http Client will send an upgrade request over Http/1
-   *    along with request content in the same request.  However,
-   *    the Jetty Server underpinning Solr does not accept this.
+   * <p>The JDK Http Client will send an upgrade request over Http/1 along 
with request content in
+   * the same request. However, the Jetty Server underpinning Solr does not 
accept this.
    *
-   *    By sending a ping before any real requests occur, the client
-   *    knows if Solr can accept Http/2, and no additional
-   *    upgrade requests will be sent.
+   * <p>We send a HEAD request first, then the client knows if Solr can accept 
Http/2, and no
+   * additional upgrade requests will be sent.
    *
-   *    See https://bugs.openjdk.org/browse/JDK-8287589
-   *    See 
https://github.com/jetty/jetty.project/issues/9998#issuecomment-1614216870
+   * <p>See https://bugs.openjdk.org/browse/JDK-8287589 See
+   * https://github.com/jetty/jetty.project/issues/9998#issuecomment-1614216870
    *
-   *    We only try once, and if it fails, we downgrade to Http/1
+   * <p>We only try once, and if it fails, we downgrade to Http/1
    *
    * @param url the url with no request parameters
    * @return true if success
    */
-  private synchronized boolean maybeTryHeadRequest(String url) {
-    if(headRequested) {
+  private boolean maybeTryHeadRequest(String url) {

Review Comment:
   Yes, this is a good idea.



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