Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-10-17 Thread via GitHub


rschmitt merged PR #709:
URL: https://github.com/apache/httpcomponents-client/pull/709


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-10-17 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3377746651

   OK, that should be better.


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-09-22 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3320376911

   > I leave it up to you if you want to merge the change-set in its present 
state or not.
   
   I'll take another look at it. The test cases can probably be made more 
consistent (and therefore less confusing) without changing their behavior.


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-09-20 Thread via GitHub


ok2c commented on code in PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#discussion_r2348789731


##
httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestConnectionClosureRace.java:
##
@@ -0,0 +1,448 @@
+/*
+ * 
+ * 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.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+
+package org.apache.hc.client5.testing.async;
+
+import org.apache.hc.client5.http.async.methods.SimpleHttpRequest;
+import org.apache.hc.client5.http.async.methods.SimpleHttpResponse;
+import org.apache.hc.client5.http.async.methods.SimpleRequestBuilder;
+import org.apache.hc.client5.http.config.ConnectionConfig;
+import org.apache.hc.client5.http.config.TlsConfig;
+import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
+import org.apache.hc.client5.http.impl.async.HttpAsyncClients;
+import org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager;
+import 
org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder;
+import org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy;
+import org.apache.hc.client5.testing.SSLTestContexts;
+import org.apache.hc.core5.http.ConnectionClosedException;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.RequestNotExecutedException;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.http.ssl.TLS;
+import org.apache.hc.core5.http2.H2Error;
+import org.apache.hc.core5.http2.H2PseudoResponseHeaders;
+import org.apache.hc.core5.http2.HttpVersionPolicy;
+import org.apache.hc.core5.http2.config.H2Param;
+import org.apache.hc.core5.http2.config.H2Setting;
+import org.apache.hc.core5.http2.frame.DefaultFrameFactory;
+import org.apache.hc.core5.http2.frame.FrameType;
+import org.apache.hc.core5.http2.hpack.HPackEncoder;
+import org.apache.hc.core5.http2.impl.io.FrameInputBuffer;
+import org.apache.hc.core5.http2.impl.io.FrameOutputBuffer;
+import org.apache.hc.core5.reactor.IOReactorConfig;
+import org.apache.hc.core5.util.ByteArrayBuffer;
+import org.apache.hc.core5.util.TimeValue;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestMethodOrder;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import javax.net.ServerSocketFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ssl.SSLSocket;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketException;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.apache.hc.core5.http2.HttpVersionPolicy.FORCE_HTTP_1;
+import static org.apache.hc.core5.http2.HttpVersionPolicy.FORCE_HTTP_2;
+import static org.apache.hc.core5.util.TimeValue.MAX_VALUE;
+import static org.apache.hc.core5.util.TimeValue.NEG_ONE_MILLISECOND;
+import static org.apache.hc.core5.util.TimeValue.ZERO_MILLISECONDS;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * This test exercises a race condition between client connection reuse and 
server-initiated connection closure. The
+ * test matrix consists of two protocols (HTTP/1.1 and HTTP/2), two connection

Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-09-17 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3299533501

   I verified that 
[apache/httpcomponents-core@ac42dec](https://github.com/apache/httpcomponents-core/commit/ac42decdf5def442928de4f17eb8d54d3f12c066)
 and 
[apache/httpcomponents-core@5de2967](https://github.com/apache/httpcomponents-core/commit/5de2967e1b76ea2adb631ed3a0d7f8a03596d0e7)
 fix the lock-up on my machine. Additionally, I tested 
b16d6d032d7e2b7e2f2b0f94c5d01375cb1ab21b, using `StaleCheckCommand` to 
implement `setValidateAfterInactivity` for HTTP/1.1 connections in 
`PoolingAsyncClientConnectionManager`. It significantly improves stale 
connection reuse for HTTPS but has no effect on HTTP. I'm satisfied with this, 
since most production usage these days is HTTPS. I think it would be ideal if 
the HTTP/1.1 duplexer implemented greedy reads, but I accept that there are 
other reasons why you don't want to do that.
   
   ```
   https: Validation disabled: Sequential requests (rapid): 2,450 succeeded; 50 
failed (98.00% success rate, 1.96% retriable)
   https: Validation enabled:  Sequential requests (rapid): 2,499 succeeded; 1 
failed (99.96% success rate, 0.00% retriable)
   https: Validation disabled: Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 50.00% retriable)
   https: Validation enabled:  Single large batch: 30 succeeded; 0 failed 
(100.00% success rate)
   https: Validation disabled: Multiple small batches: 10 succeeded; 5 failed 
(66.67% success rate, 26.67% retriable)
   https: Validation enabled:  Multiple small batches: 14 succeeded; 1 failed 
(93.33% success rate, 0.00% retriable)
   
   http: Validation disabled: Sequential requests (rapid): 2,475 succeeded; 25 
failed (99.00% success rate, 0.76% retriable)
   http: Validation enabled:  Sequential requests (rapid): 2,493 succeeded; 7 
failed (99.72% success rate, 0.00% retriable)
   http: Validation disabled: Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 0.00% retriable)
   http: Validation enabled:  Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 0.00% retriable)
   http: Validation disabled: Multiple small batches: 10 succeeded; 5 failed 
(66.67% success rate, 0.00% retriable)
   http: Validation enabled:  Multiple small batches: 10 succeeded; 5 failed 
(66.67% success rate, 0.00% retriable)
   ```


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-09-16 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3299627469

   > I think it would be ideal if the HTTP/1.1 duplexer implemented greedy 
reads, but I accept that there are other reasons why you don't want to do that.
   
   @rschmitt What a minute. I did make the HTTP/1.1 duplexer read incoming data 
greedily with 
https://github.com/apache/httpcomponents-core/commit/be71c3aab1d82a1948fac22684b9b388f9e855d5.
 What I did not want to do is to add an extra read at the end of the message 
only to make things marginally better for endpoints with broken HTTP/1.1 
connection persistence while adding an overhead of an unnecessary i/o operation 
to well-behaving ones.


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-09-16 Thread via GitHub


ok2c commented on code in PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#discussion_r2353121202


##
httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestConnectionClosureRace.java:
##
@@ -0,0 +1,448 @@
+/*
+ * 
+ * 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.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+
+package org.apache.hc.client5.testing.async;
+
+import org.apache.hc.client5.http.async.methods.SimpleHttpRequest;
+import org.apache.hc.client5.http.async.methods.SimpleHttpResponse;
+import org.apache.hc.client5.http.async.methods.SimpleRequestBuilder;
+import org.apache.hc.client5.http.config.ConnectionConfig;
+import org.apache.hc.client5.http.config.TlsConfig;
+import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
+import org.apache.hc.client5.http.impl.async.HttpAsyncClients;
+import org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager;
+import 
org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder;
+import org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy;
+import org.apache.hc.client5.testing.SSLTestContexts;
+import org.apache.hc.core5.http.ConnectionClosedException;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.RequestNotExecutedException;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.http.ssl.TLS;
+import org.apache.hc.core5.http2.H2Error;
+import org.apache.hc.core5.http2.H2PseudoResponseHeaders;
+import org.apache.hc.core5.http2.HttpVersionPolicy;
+import org.apache.hc.core5.http2.config.H2Param;
+import org.apache.hc.core5.http2.config.H2Setting;
+import org.apache.hc.core5.http2.frame.DefaultFrameFactory;
+import org.apache.hc.core5.http2.frame.FrameType;
+import org.apache.hc.core5.http2.hpack.HPackEncoder;
+import org.apache.hc.core5.http2.impl.io.FrameInputBuffer;
+import org.apache.hc.core5.http2.impl.io.FrameOutputBuffer;
+import org.apache.hc.core5.reactor.IOReactorConfig;
+import org.apache.hc.core5.util.ByteArrayBuffer;
+import org.apache.hc.core5.util.TimeValue;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestMethodOrder;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import javax.net.ServerSocketFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ssl.SSLSocket;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketException;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.apache.hc.core5.http2.HttpVersionPolicy.FORCE_HTTP_1;
+import static org.apache.hc.core5.http2.HttpVersionPolicy.FORCE_HTTP_2;
+import static org.apache.hc.core5.util.TimeValue.MAX_VALUE;
+import static org.apache.hc.core5.util.TimeValue.NEG_ONE_MILLISECOND;
+import static org.apache.hc.core5.util.TimeValue.ZERO_MILLISECONDS;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * This test exercises a race condition between client connection reuse and 
server-initiated connection closure. The
+ * test matrix consists of two protocols (HTTP/1.1 and HTTP/2), two connection

Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-09-16 Thread via GitHub


rschmitt commented on code in PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#discussion_r2352950278


##
httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestConnectionClosureRace.java:
##
@@ -0,0 +1,448 @@
+/*
+ * 
+ * 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.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ *
+ */
+
+package org.apache.hc.client5.testing.async;
+
+import org.apache.hc.client5.http.async.methods.SimpleHttpRequest;
+import org.apache.hc.client5.http.async.methods.SimpleHttpResponse;
+import org.apache.hc.client5.http.async.methods.SimpleRequestBuilder;
+import org.apache.hc.client5.http.config.ConnectionConfig;
+import org.apache.hc.client5.http.config.TlsConfig;
+import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
+import org.apache.hc.client5.http.impl.async.HttpAsyncClients;
+import org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager;
+import 
org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder;
+import org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy;
+import org.apache.hc.client5.testing.SSLTestContexts;
+import org.apache.hc.core5.http.ConnectionClosedException;
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.http.RequestNotExecutedException;
+import org.apache.hc.core5.http.message.BasicHeader;
+import org.apache.hc.core5.http.ssl.TLS;
+import org.apache.hc.core5.http2.H2Error;
+import org.apache.hc.core5.http2.H2PseudoResponseHeaders;
+import org.apache.hc.core5.http2.HttpVersionPolicy;
+import org.apache.hc.core5.http2.config.H2Param;
+import org.apache.hc.core5.http2.config.H2Setting;
+import org.apache.hc.core5.http2.frame.DefaultFrameFactory;
+import org.apache.hc.core5.http2.frame.FrameType;
+import org.apache.hc.core5.http2.hpack.HPackEncoder;
+import org.apache.hc.core5.http2.impl.io.FrameInputBuffer;
+import org.apache.hc.core5.http2.impl.io.FrameOutputBuffer;
+import org.apache.hc.core5.reactor.IOReactorConfig;
+import org.apache.hc.core5.util.ByteArrayBuffer;
+import org.apache.hc.core5.util.TimeValue;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestMethodOrder;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import javax.net.ServerSocketFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ssl.SSLSocket;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketException;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.apache.hc.core5.http2.HttpVersionPolicy.FORCE_HTTP_1;
+import static org.apache.hc.core5.http2.HttpVersionPolicy.FORCE_HTTP_2;
+import static org.apache.hc.core5.util.TimeValue.MAX_VALUE;
+import static org.apache.hc.core5.util.TimeValue.NEG_ONE_MILLISECOND;
+import static org.apache.hc.core5.util.TimeValue.ZERO_MILLISECONDS;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * This test exercises a race condition between client connection reuse and 
server-initiated connection closure. The
+ * test matrix consists of two protocols (HTTP/1.1 and HTTP/2), two connec

Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-09-15 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3291489077

   @rschmitt This 
https://github.com/apache/httpcomponents-core/commit/ac42decdf5def442928de4f17eb8d54d3f12c066
 should fix the immediate problem with a race between connection status and 
command submission. This 
https://github.com/apache/httpcomponents-core/commit/5de2967e1b76ea2adb631ed3a0d7f8a03596d0e7
 should make sure that `#disconnected` method of the protocol handler gets 
executed as late as possible after the underlying i/o session has been fully 
closed out
   
   Both `master` and `5.3.x` no longer get stuck for me due to a command left 
in a limbo by a race with connection shutdown.
   
   ```
   h2: Validation disabled: Sequential requests (slow): 10 succeeded; 0 failed 
(100.00% success rate)
   h2: Validation enabled:  Sequential requests (slow): 10 succeeded; 0 failed 
(100.00% success rate)
   h2: Validation disabled: Sequential requests (rapid): 2,464 succeeded; 36 
failed (98.56% success rate, 1.44% retriable)
   h2: Validation enabled:  Sequential requests (rapid): 2,500 succeeded; 0 
failed (100.00% success rate)
   h2: Validation disabled: Single large batch: 15 succeeded; 15 failed (50.00% 
success rate, 30.00% retriable)
   h2: Validation enabled:  Single large batch: 30 succeeded; 0 failed (100.00% 
success rate)
   h2: Validation disabled: Multiple small batches: 10 succeeded; 5 failed 
(66.67% success rate, 20.00% retriable)
   h2: Validation enabled:  Multiple small batches: 15 succeeded; 0 failed 
(100.00% success rate)
   
   h2c: Validation disabled: Sequential requests (slow): 10 succeeded; 0 failed 
(100.00% success rate)
   h2c: Validation enabled:  Sequential requests (slow): 10 succeeded; 0 failed 
(100.00% success rate)
   h2c: Validation disabled: Sequential requests (rapid): 2,180 succeeded; 320 
failed (87.20% success rate, 12.76% retriable)
   h2c: Validation enabled:  Sequential requests (rapid): 2,500 succeeded; 0 
failed (100.00% success rate)
   h2c: Validation disabled: Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 50.00% retriable)
   h2c: Validation enabled:  Single large batch: 30 succeeded; 0 failed 
(100.00% success rate)
   h2c: Validation disabled: Multiple small batches: 10 succeeded; 5 failed 
(66.67% success rate, 26.67% retriable)
   h2c: Validation enabled:  Multiple small batches: 15 succeeded; 0 failed 
(100.00% success rate)
   
   https: Validation disabled: Sequential requests (slow): 10 succeeded; 0 
failed (100.00% success rate)
   https: Validation enabled:  Sequential requests (slow): 10 succeeded; 0 
failed (100.00% success rate)
   https: Validation disabled: Sequential requests (rapid): 1,305 succeeded; 
1,195 failed (52.20% success rate, 47.60% retriable)
   https: Validation enabled:  Sequential requests (rapid): 1,316 succeeded; 
1,184 failed (52.64% success rate, 47.32% retriable)
   https: Validation disabled: Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 0.00% retriable)
   https: Validation enabled:  Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 0.00% retriable)
   https: Validation disabled: Multiple small batches: 10 succeeded; 5 failed 
(66.67% success rate, 20.00% retriable)
   https: Validation enabled:  Multiple small batches: 10 succeeded; 5 failed 
(66.67% success rate, 6.67% retriable)
   
   http: Validation disabled: Sequential requests (slow): 10 succeeded; 0 
failed (100.00% success rate)
   http: Validation enabled:  Sequential requests (slow): 10 succeeded; 0 
failed (100.00% success rate)
   http: Validation disabled: Sequential requests (rapid): 1,313 succeeded; 
1,187 failed (52.52% success rate, 38.68% retriable)
   http: Validation enabled:  Sequential requests (rapid): 1,332 succeeded; 
1,168 failed (53.28% success rate, 38.56% retriable)
   http: Validation disabled: Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 0.00% retriable)
   http: Validation enabled:  Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 0.00% retriable)
   http: Validation disabled: Multiple small batches: 10 succeeded; 5 failed 
(66.67% success rate, 0.00% retriable)
   http: Validation enabled:  Multiple small batches: 10 succeeded; 5 failed 
(66.67% success rate, 0.00% retriable)
   ```


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-09-14 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3289848160

   @rschmitt I can reliably reproduce the lock-up on one of my client's Windows 
machines. I will be looking into it.


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-28 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3233190324

   @rschmitt And no luck with the reproducer
   
   ```
   h2: Validation disabled: Sequential requests (rapid): 4,998 succeeded; 2 
failed (99.96% success rate, 0.04% retriable)
   h2: Validation enabled:  Sequential requests (rapid): 5,000 succeeded; 0 
failed (100.00% success rate)
   ```
   ```
   openjdk version "1.8.0_462"
   OpenJDK Runtime Environment Corretto-8.462.08.1 (build 1.8.0_462-b08)
   OpenJDK 64-Bit Server VM Corretto-8.462.08.1 (build 25.462-b08, mixed mode)
   ```
   ```
   core: 0e22b407c741f6f1af73bd199abf4e7c329c9df7
   client: f176d922df466bf06924f2b19474352141bafa7c
   ```


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-28 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3233041491

   > When the connection pool is full, does the async client ever just wait for 
a connection to become available, instead of pipelining the request onto an 
existing connection? 
   
   @rschmitt I made a mistake. I was looking at the problem at the core 
protocol level but I forgot about the connection pool preventing request 
pipelining at the client level by leasing connections to a single request at a 
time. 
   
   My point still stands, though. The test cases behave inconsistently. This 
needs to be fixed.


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-27 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3229793952

   Oh, duh, I see your point now. You're saying that the HTTP/1.1 tests _think_ 
they're testing a race between connection leasing and half-close, but they're 
actually testing a race within the duplexer, between the write path (send the 
next pipelined request) and the read path (read and process connection closure).
   
   What I don't understand, then, is why the use of `StaleCheckCommand` [showed 
such an 
improvement](https://github.com/apache/httpcomponents-core/pull/547#issuecomment-3176830951)
 when combined with greedy reads in the HTTP/1.1 duplexer (i.e. read the input 
buffer until it returns 0 or -1). If `futures.add(sendPing(client))` causes the 
request to immediately be pipelined on an assigned connection, then 
`StaleCheckCommand` shouldn't make a difference, but in fact it makes a 
dramatic difference.
   
   When the connection pool is full, does the async client _ever_ just wait for 
a connection to become available, instead of pipelining the request onto an 
existing connection? Alternatively, is there logic within the client 
(independent of any `RetryStrategy`) that can take unsent pipelined requests 
and reassign them to another connection?
   
   I'll also check and see whether I can replicate my earlier experiment.


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-27 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3229349684

   > I'm not sure what you mean. 
   
   @rschmitt Okay. I will have to be blunt, then
   
   > The tests are all doing what I intend them to do.
   
   Then, in their present form the tests are meaningless / useless for HTTP/1.1 
due to the request pipelining. There is no point committing them in their 
present shape
   
   Some do 
   
   ```
   final Future f = sendPing(client);
   try {
   f.get();
   } catch (final ExecutionException ignore) {
   }
   futures.add(f);
   ```
   which is correct.
   
   Others do 
   ```
   futures.add(sendPing(client));
   ```
   which is wrong in the given context due to the use of request pipleining 
with the HTTP/1.1 transport.
   
   > I bet if you [grab the latest 
version](https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html)
 you'll be able to reproduce the problem.
   
   I will get the latest Java 8 JRE and will try out to reproduce the defect 
with it.


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-27 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3229199987

   No obvious smoking gun in the release notes: 
https://builds.shipilev.net/backports-monitor/release-notes-openjdk8u402.html


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-27 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3229086600

   I bisected the Corretto 8 releases available from mise. It looks like 
corretto-8.392.08.1 is the most recent release that does _not_ reproduce the 
problem. The next available release, corretto-8.402.07.1, exhibits the issue.


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-27 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3229020675

   > The `testSlowSequentialRequests`, `testOneLargeBatchOfRequests`, and 
`testSpacedOutBatchesOfRequests` tests still submit requests in a tight loop. 
The `testRapidSequentialRequests` test behaves correctly.
   
   I'm not sure what you mean. The tests are all doing what I intend them to do.
   
   > ```
   > openjdk version "1.8.0_342"
   > OpenJDK Runtime Environment Corretto-8.342.07.4 (build 1.8.0_342-b07)
   > OpenJDK 64-Bit Server VM Corretto-8.342.07.4 (build 25.342-b07, mixed mode)
   > ```
   
   I'm _really_ glad you posted this. I'm running with Corretto-8.462.08.1 
(build 1.8.0_462-b08). Just for grins, I tried the reproducer with 
corretto-8.342.07.3, installed via https://github.com/jdx/mise (handy dandy!), 
and it's not reproducing the problem. I bet if you [grab the latest 
version](https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html)
 (or `mise install [email protected]`) you'll be able to reproduce the 
problem. If you install mise, you can do this by running:
   
   ```
   mise shell [email protected]
   ./mvnw -Pslow-tests,-use-toolchains
   ```


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-26 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3223406450

   @rschmitt I honestly do not know how to fix a problem I am unable to 
reproduce
   
   ```
   h2: Validation disabled: Sequential requests (rapid): 4,998 succeeded; 2 
failed (99.96% success rate, 0.04% retriable)
   ```
   ```
   Linux ok2c 6.8.0-78-generic #78-Ubuntu SMP PREEMPT_DYNAMIC Tue Aug 12 
11:34:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
   ```
   ```
   openjdk version "1.8.0_342"
   OpenJDK Runtime Environment Corretto-8.342.07.4 (build 1.8.0_342-b07)
   OpenJDK 64-Bit Server VM Corretto-8.342.07.4 (build 25.342-b07, mixed mode)
   ```


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-26 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3223210249

   @rschmitt The `testSlowSequentialRequests`, `testOneLargeBatchOfRequests`, 
and `testSpacedOutBatchesOfRequests` tests still submit requests in a tight 
loop. The `testRapidSequentialRequests` test behaves correctly. 


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-25 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3221522295

   FYI, I can also reproduce the h2 hang against httpcore 5.3.4, in addition to 
https://github.com/apache/httpcomponents-core/commit/be71c3aab1d82a1948fac22684b9b388f9e855d5.
 It's definitely timing-sensitive. Newer and faster JDKs are less likely to 
reproduce the problem, and h2c is less likely to hang than TLS 1.3, which is 
less likely to hang than TLS 1.2.


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-25 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3221492859

   I've amended the PR to rebase atop the latest `origin/master` and to move 
this test to a separate profile through the power of JUnit 5 tags. I figured 
that this is more likely to be useful in the future than special-casing this 
test, moving it to an example, or just marking it as `@Disabled`, especially if 
you need to reproduce it in GitHub CI or something. 


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-25 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3221470760

   > > The problem appears to be OS / JRE specific
   > 
   > Testing against 
[apache/httpcomponents-core@be71c3a](https://github.com/apache/httpcomponents-core/commit/be71c3aab1d82a1948fac22684b9b388f9e855d5),
 I can reproduce the HTTP/2 hang on Linux (m5.2xlarge instance running Linux 
5.10). I noticed that on macOS, it's much harder to reproduce the bug by 
running the tests on JDK21, so make sure you're running them on JDK8.
   
   @rschmitt I am on vacation at the moment and will not be able to lay my 
hands on a different hardware until mid September. My Linux box is all I have. 
I always use Java 8 by default.  I have never been able to reproduce it. Not 
once.
   
   I will see if I can reproduce the lock-up on GitHub CI. 


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-25 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3221451400

   > > The HTTP/1.1 protocol handler by default aggressively pipelines request 
messages.
   > 
   > That's an important detail. How does this work? Does pipelining only kick 
in when the max connection pool size is reached? How does this interact with 
the `connectionRequestTimeout`? How can pipelining be disabled? Which version 
of the client enabled pipelining by default?
   
   @rschmitt HTTP/1.1 protocol handler has been working like that since 
5.0-alpha1. Requests have always been immediately written out to the connection 
as soon as submitted by the caller for execution.  I do not see a reason why it 
should be different. It is fully protocol conformant while dropping connection 
without signalling it is not.
   
   If you insist we can add a config knob to disable it.


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-25 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3221259325

   > The problem appears to be OS / JRE specific
   
   Testing against 
https://github.com/apache/httpcomponents-core/commit/be71c3aab1d82a1948fac22684b9b388f9e855d5,
 I can reproduce the HTTP/2 hang on Linux (m5.2xlarge instance running Linux 
5.10). I noticed that on macOS, it's much harder to reproduce the bug by 
running the tests on JDK21, so make sure you're running them on JDK8.


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-25 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3221120219

   > The HTTP/1.1 protocol handler by default aggressively pipelines request 
messages.
   
   That's an important detail. How does this work? Does pipelining only kick in 
when the max connection pool size is reached? How does this interact with the 
`connectionRequestTimeout`? How can pipelining be disabled? Which version of 
the client enabled pipelining by default?


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-25 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3219881134

   @rschmitt I believe I have found the underlying cause of the problem (or 
misunderstanding if you agree to see it that way)
   
   Here is the thing. The HTTP/1.1 by default aggressively pipeline request 
messages. What that basically means the client can write out n requests before 
the server gets to process the first once and drop the connection.
   
   ```
   exchange 1: POST /ping
   exchange 1: stale-check (success)
   exchange 2: POST /ping
   exchange 2: stale-check (success)
   exchange 3: POST /ping
   exchange 3: stale-check (success)
   exchange 1: 200 OK
   exchange 1: server closes connection
   exchange 2: boom
   exchange 3: boom
   ```
   The stale connection check cannot help when pipelining is being employed 
because the connection is perfectly valid at the time of request initiation.
   
   The H2 tests do not exhibit this problem because the server limits the 
number of concurrent streams to 1
   
   ```
   out.write(ff.createSettings(
   ...
   new H2Setting(H2Param.MAX_CONCURRENT_STREAMS, 1),
   ...
   ), outputStream);
   ```
   
   I do not know if this is intentional or not but with the message pipelining 
not used, I get 100% reliability of message exchanges with both HTTP/1.1 and H2 
using code with slight modifications to ensure HTTP/1.1 get executed 
sequentially
   
   ```
   h2: Validation disabled: Sequential requests (slow): 10 succeeded; 0 failed 
(100.00% success rate)
   h2: Validation enabled:  Sequential requests (slow): 10 succeeded; 0 failed 
(100.00% success rate)
   h2: Validation disabled: Sequential requests (rapid): 199 succeeded; 1 
failed (99.50% success rate, 0.50% retriable)
   h2: Validation enabled:  Sequential requests (rapid): 200 succeeded; 0 
failed (100.00% success rate)
   h2: Validation disabled: Single large batch: 30 succeeded; 0 failed (100.00% 
success rate)
   h2: Validation enabled:  Single large batch: 30 succeeded; 0 failed (100.00% 
success rate)
   h2: Validation disabled: Multiple small batches: 15 succeeded; 0 failed 
(100.00% success rate)
   h2: Validation enabled:  Multiple small batches: 15 succeeded; 0 failed 
(100.00% success rate)
   
   h2c: Validation disabled: Sequential requests (slow): 10 succeeded; 0 failed 
(100.00% success rate)
   h2c: Validation enabled:  Sequential requests (slow): 10 succeeded; 0 failed 
(100.00% success rate)
   h2c: Validation disabled: Sequential requests (rapid): 200 succeeded; 0 
failed (100.00% success rate)
   h2c: Validation enabled:  Sequential requests (rapid): 200 succeeded; 0 
failed (100.00% success rate)
   h2c: Validation disabled: Single large batch: 30 succeeded; 0 failed 
(100.00% success rate)
   h2c: Validation enabled:  Single large batch: 30 succeeded; 0 failed 
(100.00% success rate)
   h2c: Validation disabled: Multiple small batches: 15 succeeded; 0 failed 
(100.00% success rate)
   h2c: Validation enabled:  Multiple small batches: 15 succeeded; 0 failed 
(100.00% success rate)
   
   https: Validation disabled: Sequential requests (slow): 10 succeeded; 0 
failed (100.00% success rate)
   https: Validation enabled:  Sequential requests (slow): 10 succeeded; 0 
failed (100.00% success rate)
   https: Validation disabled: Sequential requests (rapid): 182 succeeded; 18 
failed (91.00% success rate, 9.00% retriable)
   https: Validation enabled:  Sequential requests (rapid): 200 succeeded; 0 
failed (100.00% success rate)
   https: Validation disabled: Single large batch: 29 succeeded; 1 failed 
(96.67% success rate, 3.33% retriable)
   https: Validation enabled:  Single large batch: 30 succeeded; 0 failed 
(100.00% success rate)
   https: Validation disabled: Multiple small batches: 15 succeeded; 0 failed 
(100.00% success rate)
   https: Validation enabled:  Multiple small batches: 15 succeeded; 0 failed 
(100.00% success rate)
   
   http: Validation disabled: Sequential requests (slow): 10 succeeded; 0 
failed (100.00% success rate)
   http: Validation enabled:  Sequential requests (slow): 10 succeeded; 0 
failed (100.00% success rate)
   http: Validation disabled: Sequential requests (rapid): 191 succeeded; 9 
failed (95.50% success rate, 4.00% retriable)
   http: Validation enabled:  Sequential requests (rapid): 200 succeeded; 0 
failed (100.00% success rate)
   http: Validation disabled: Single large batch: 29 succeeded; 1 failed 
(96.67% success rate, 0.00% retriable)
   http: Validation enabled:  Single large batch: 30 succeeded; 0 failed 
(100.00% success rate)
   http: Validation disabled: Multiple small batches: 15 succeeded; 0 failed 
(100.00% success rate)
   http: Validation enabled:  Multiple small batches: 15 succeeded; 0 failed 
(100.00% success rate)
   ```
   
   
   


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

Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-24 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3218056909

   @rschmitt I am unable to reproduce the problem neither with core `5.3.4` 
(stable), nor `5.3.5-SNAPSHOT` not `5.4-alpha1-SNAPSHOT`. I need your help with 
the reproducer. I am traveling right now and only have my Ubuntu Linux box at 
my disposal. The problem appears to be OS / JRE specific


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-24 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3217986687

   > Currently, this class seems to be exposing a serious bug in the HTTP/2 
client.
   
   @rschmitt Curiously enough I am unable to reproduce the problem. I have run 
the test suite with the `#testRapidSequentialRequests` enabled against the 
latest core master  and client master and all tests pass
   
   ```
   h2: Validation disabled: Sequential requests (slow): 5 succeeded; 5 failed 
(50.00% success rate, 50.00% retriable)
   h2: Validation enabled:  Sequential requests (slow): 10 succeeded; 0 failed 
(100.00% success rate)
   h2: Validation disabled: Sequential requests (rapid): 2,499 succeeded; 1 
failed (99.96% success rate, 0.04% retriable)
   h2: Validation enabled:  Sequential requests (rapid): 2,500 succeeded; 0 
failed (100.00% success rate)
   h2: Validation disabled: Single large batch: 15 succeeded; 15 failed (50.00% 
success rate, 50.00% retriable)
   h2: Validation enabled:  Single large batch: 30 succeeded; 0 failed (100.00% 
success rate)
   h2: Validation disabled: Multiple small batches: 8 succeeded; 7 failed 
(53.33% success rate, 46.67% retriable)
   h2: Validation enabled:  Multiple small batches: 15 succeeded; 0 failed 
(100.00% success rate)
   
   h2c: Validation disabled: Sequential requests (slow): 5 succeeded; 5 failed 
(50.00% success rate, 50.00% retriable)
   h2c: Validation enabled:  Sequential requests (slow): 10 succeeded; 0 failed 
(100.00% success rate)
   h2c: Validation disabled: Sequential requests (rapid): 2,500 succeeded; 0 
failed (100.00% success rate)
   h2c: Validation enabled:  Sequential requests (rapid): 2,500 succeeded; 0 
failed (100.00% success rate)
   h2c: Validation disabled: Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 50.00% retriable)
   h2c: Validation enabled:  Single large batch: 30 succeeded; 0 failed 
(100.00% success rate)
   h2c: Validation disabled: Multiple small batches: 8 succeeded; 7 failed 
(53.33% success rate, 46.67% retriable)
   h2c: Validation enabled:  Multiple small batches: 15 succeeded; 0 failed 
(100.00% success rate)
   
   https: Validation disabled: Sequential requests (slow): 5 succeeded; 5 
failed (50.00% success rate, 30.00% retriable)
   https: Validation enabled:  Sequential requests (slow): 5 succeeded; 5 
failed (50.00% success rate, 50.00% retriable)
   https: Validation disabled: Sequential requests (rapid): 2,392 succeeded; 
108 failed (95.68% success rate, 4.28% retriable)
   https: Validation enabled:  Sequential requests (rapid): 2,457 succeeded; 43 
failed (98.28% success rate, 1.72% retriable)
   https: Validation disabled: Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 46.67% retriable)
   https: Validation enabled:  Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 50.00% retriable)
   https: Validation disabled: Multiple small batches: 8 succeeded; 7 failed 
(53.33% success rate, 46.67% retriable)
   https: Validation enabled:  Multiple small batches: 8 succeeded; 7 failed 
(53.33% success rate, 46.67% retriable)
   
   http: Validation disabled: Sequential requests (slow): 10 succeeded; 0 
failed (100.00% success rate)
   http: Validation enabled:  Sequential requests (slow): 10 succeeded; 0 
failed (100.00% success rate)
   http: Validation disabled: Sequential requests (rapid): 2,066 succeeded; 434 
failed (82.64% success rate, 17.24% retriable)
   http: Validation enabled:  Sequential requests (rapid): 2,304 succeeded; 196 
failed (92.16% success rate, 7.72% retriable)
   http: Validation disabled: Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 0.00% retriable)
   http: Validation enabled:  Single large batch: 15 succeeded; 15 failed 
(50.00% success rate, 0.00% retriable)
   http: Validation disabled: Multiple small batches: 10 succeeded; 5 failed 
(66.67% success rate, 0.00% retriable)
   http: Validation enabled:  Multiple small batches: 10 succeeded; 5 failed 
(66.67% success rate, 0.00% retriable)
   ```
   I was also unable to reproduce the problem with the latest core 5.3.x and 
the latest client 5.5.x.
   
   ```
   h2: Validation disabled: Sequential requests (slow): 5 succeeded; 5 failed 
(50.00% success rate, 50.00% retriable)
   h2: Validation enabled:  Sequential requests (slow): 10 succeeded; 0 failed 
(100.00% success rate)
   h2: Validation disabled: Sequential requests (rapid): 2,500 succeeded; 0 
failed (100.00% success rate)
   h2: Validation enabled:  Sequential requests (rapid): 2,500 succeeded; 0 
failed (100.00% success rate)
   h2: Validation disabled: Single large batch: 15 succeeded; 15 failed (50.00% 
success rate, 50.00% retriable)
   h2: Validation enabled:  Single large batch: 30 succeeded; 0 failed (100.00% 
success rate)
   h2: Validation disabled: Multiple small batches: 8 succeeded; 7 failed 
(53.33% success rate, 46.67% retriable)
   h2: Validation enabled:  Multiple small 

Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-23 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3217151921

   @ok2c OK


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-21 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3209704341

   > Currently, this class seems to be exposing a serious bug in the HTTP/2 
client. 
   
   @rschmitt I have started a major revision of the H2 protocol handling code 
and have been making minor corrections / improvements to the H2 stream 
termination logic. 
   
   I am going to use your code as a reproducer for the defect you have been 
seeing. However I still do think there is little value in running this test 
with every CI run. This is a type of integration test one may want to execute 
prior to a GA release or after having done a major code refactoring. 
   
   I would really appreciate if you could convert these tests to a pure example 
class or mark them as `@Disabled`


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-20 Thread via GitHub


rschmitt commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3207332613

   @ok2c Currently, this class seems to be exposing a serious bug in the HTTP/2 
client. `testRapidSequentialRequests` tends to hang on h2 and possibly h2c; the 
stack traces seem to indicate that there's a race condition that causes 
connections to be dropped. My current intention is to submit this as a 
reproducer of this bug that runs with all the other tests. Once we find and fix 
that bug, I can mark this test `@Disabled`, add a `@Tag`, and/or convert it to 
a pure example class.
   
   This class's tests run in about seven seconds on my machine, but I'm not 
planning on leaving it enabled beyond the short term, because it burns through 
a lot of sockets and ephemeral ports which can cause problems.


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



Re: [PR] Add TestConnectionClosureRace [httpcomponents-client]

2025-08-19 Thread via GitHub


ok2c commented on PR #709:
URL: 
https://github.com/apache/httpcomponents-client/pull/709#issuecomment-3201545275

   @rschmitt Does this really need to be a JUnit class? Does it need to be 
executed with each and every CI run? Can still just be a stand-alone executable 
with a main method? 


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