VishnuPriyaChandraSekar commented on code in PR #4626:
URL: https://github.com/apache/solr/pull/4626#discussion_r3599698093


##########
solr/solrj/src/test/org/apache/solr/client/solrj/impl/LB2SolrClientTest.java:
##########
@@ -405,6 +405,9 @@ private class TimeoutZombieTestContext implements 
AutoCloseable {
           new HttpJettySolrClient.Builder()
               .withConnectionTimeout(1000, TimeUnit.MILLISECONDS)
               .withIdleTimeout(1, TimeUnit.MILLISECONDS)
+              // override the infinite request timeout with idle timeout to 
ensure idle requests
+              // times out.

Review Comment:
   The idle timeout is ineffective for this test.  The http client (through 
Jetty) uses HTTP2 protocol to communicate  with the server. After establishing 
connection with the server, it tries to send the request headers to the server 
as part of creating HTTP streams. However, the fake server fails to ack the 
headers.
   The client is waiting infinitely for the server to ack and the connection 
never times out because of following reasons
   * The idle timeout in the request (1ms) is not applied as the Jetty applies 
it only after receiving ack from the server [1]. The default idle timeout (-1) 
set in the HttpJettySolrClient is applied  [2]
   * The default request timeout was changed to -1 
   
   I was wondering how the test worked before. It looks like the test wanted to 
simulate socket timeout, however it was not happening. The HTTP request was 
timing out because of request timeout (previously it took idle timeout as 
default value.)
   
   In order to fix the test, either the fake server must ack the header (Gemini 
says it is possible however I haven't tried first hand) or simulate request 
timeout instead. Let me know which one choose 
   
   Thanks to the Jetty logs [3] for helping me to understand this. 
   
   [1] 
https://github.com/jetty/jetty.project/blob/jetty-12.1.x/jetty-core/jetty-http2/jetty-http2-client-transport/src/main/java/org/eclipse/jetty/http2/client/transport/internal/HttpSenderOverHTTP2.java#L203
   [2] 
https://github.com/apache/solr/blob/main/solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/HttpJettySolrClient.java#L304
   [3] Jetty logs: 
https://gist.github.com/VishnuPriyaChandraSekar/0e3d428cbfdd7025c18562356af7da4d



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