[ 
https://issues.apache.org/jira/browse/SOLR-17589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17904617#comment-17904617
 ] 

James Dyer commented on SOLR-17589:
-----------------------------------

[~p...@search-solutions.net] This is a known issue.  The HEAD request is a 
workaround for an incompatibility between the JDK client and Jetty, under which 
Solr runs.  See [1] and [2] for more details.  When developing this, I did not 
like it that it generated an ugly error in the log either, but I did not think 
of a better solution at the time.  I was looking for something lightweight that 
would work no matter how Solr is configured.  I had also considered sending a 
request to the ping request handler.  I do not remember why i did not go with 
the ping, but it might be that it can be disabled and/or moved to a different 
path from the default via configuration.

We could modify the server side to better handle HEAD requests, or maybe there 
is something better we could do on the client side?  Concrete suggestions and 
especially PRs are welcome!

-----
[1] https://bugs.openjdk.org/browse/JDK-8287589
[2] https://github.com/jetty/jetty.project/issues/9998

> First use of PUT/POST request with HttpJdkSolrClient generates error log 
> entry on solr server due to initial HEAD request
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-17589
>                 URL: https://issues.apache.org/jira/browse/SOLR-17589
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: clients - java
>    Affects Versions: 9.7
>            Reporter: Paul Blanchaert
>            Priority: Minor
>
> The first call of the maybeTryHeadRequest of the HttpJdkSolrClient (used in 
> the preparePutOrPost) causes an ERROR log entry in the solr server log even 
> while the "HEAD" request is considered successful in the client.
> The client only performs this request once.
> The error on server side is due to the "empty" request: "missing content 
> stream"
> 2024-12-10 08:31:48 2024-12-10 07:31:48.877 INFO  (qtp1380924218-23-solr-123) 
> [c:collection1 s:shard1 r:core_node2 x:collection1_shard1_replica_n1 
> t:solr-123] o.a.s.u.p.LogUpdateProcessorFactory webapp=/solr path=/update 
> params={}{} 0 0
> 2024-12-10 08:31:48 2024-12-10 07:31:48.877 ERROR (qtp1380924218-23-solr-123) 
> [c:collection1 s:shard1 r:core_node2 x:collection1_shard1_replica_n1 
> t:solr-123] o.a.s.h.RequestHandlerBase Client exception => 
> org.apache.solr.common.SolrException: missing content stream
> 2024-12-10 08:31:48     at 
> org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:93)
> 2024-12-10 08:31:48 org.apache.solr.common.SolrException: missing content 
> stream
> 2024-12-10 08:31:48     at 
> org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:93)
>  ~[?:?]
> 2024-12-10 08:31:48     at 
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:226)
>  ~[?:?]
> 2024-12-10 08:31:48     at 
> org.apache.solr.core.SolrCore.execute(SolrCore.java:2880) ~[?:?]
> 2024-12-10 08:31:48     at 
> org.apache.solr.servlet.HttpSolrCall.executeCoreRequest(HttpSolrCall.java:890)
>  ~[?:?]
> 2024-12-10 08:31:48     at 
> org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:576) ~[?:?]
> 2024-12-10 08:31:48     at 
> org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:251)
>  ~[?:?]
> 2024-12-10 08:31:48     at 
> org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:208)
>  ~[?:?]
> 2024-12-10 08:31:48     at 
> org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:243)
>  ~[?:?]
> 2024-12-10 08:31:48     at 
> org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:213) 
> ~[?:?]
> 2024-12-10 08:31:48     at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:202)
>  ~[?:?]
> 2024-12-10 08:31:48     at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:184)
>  ~[?:?]
> 2024-12-10 08:31:48     at 
> org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210) 
> ~[jetty-servlet-10.0.22.jar:10.0.22]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to