You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "synth3 (Jira)" <ji...@apache.org> on 2020/10/19 21:51:00 UTC

[jira] [Created] (HTTPCLIENT-2122) Details of H2ConnectionException are omitted by ConnectionClosedException

synth3 created HTTPCLIENT-2122:
----------------------------------

             Summary: Details of H2ConnectionException are omitted by ConnectionClosedException
                 Key: HTTPCLIENT-2122
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2122
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient (async)
    Affects Versions: 5.0.3
            Reporter: synth3
         Attachments: hc5_session.log

As said in a comment of ticket HTTPCLIENT-2120 following a description of the error handling issue:

When I unbiasedly tried to establish a HTTP/2 connection via HTTP-Proxy I noticed that in the logs there is a frame size error that is not obvious from the exception thrown by {{Future<SimpleHttpResponse>}}{{.get()}}:
 * In the logs I can see {{Code FRAME_SIZE_ERROR}} and {{Frame size exceeds maximum}} which might be caused by trying to consume the HTTP-1.1 proxy response as HTTP/2
 ** The associated Exception ({{H2ConnectionException: Frame size exceeds maximum}}) is omitted in {{org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.onException(Exception)}} where {{((ExecutableCommand) command).failed(new ConnectionClosedException())}} is called

The following snipped can be used to reproduce the issue ({{coconutpi:8080}} points to a basic squid 4.6 setup on a raspberry pi in my home network):
{code:java}
CloseableHttpAsyncClient client = HttpAsyncClients.custom().setVersionPolicy(HttpVersionPolicy.FORCE_HTTP_2)
        .setProxy(HttpHost.create("coconutpi:8080")).build();
client.start();
// throws org.apache.hc.core5.http.ConnectionClosedException: Connection is closed
client.execute(SimpleHttpRequests.get("https://http2.pro/client"), null).get();
{code}
StackTrace of exception thrown by {{Future<SimpleHttpResponse>.get()}}:
{code:java}
ava.util.concurrent.ExecutionException: org.apache.hc.core5.http.ConnectionClosedException: Connection is closed
	at org.apache.hc.core5.concurrent.BasicFuture.getResult(BasicFuture.java:72)
	at org.apache.hc.core5.concurrent.BasicFuture.get(BasicFuture.java:85)
	at com.test.MinimalProxyTest.basicTest(MinimalProxyTest.java:40)
	at com.test.MinimalProxyTest.main(MinimalProxyTest.java:26)
Caused by: org.apache.hc.core5.http.ConnectionClosedException: Connection is closed
	at org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.onException(AbstractH2StreamMultiplexer.java:661)
	at org.apache.hc.core5.http2.impl.nio.AbstractH2IOEventHandler.exception(AbstractH2IOEventHandler.java:91)
	at org.apache.hc.core5.http2.impl.nio.ClientH2IOEventHandler.exception(ClientH2IOEventHandler.java:39)
Caused by: org.apache.hc.core5.http.ConnectionClosedException: Connection is closed
	at org.apache.hc.core5.reactor.InternalDataChannel.onException(InternalDataChannel.java:162)
	at org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:55)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:179)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:128)
	at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:85)
	at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
	at java.base/java.lang.Thread.run(Thread.java:834)
{code}
StackTrace of the omitted exception:
{code:java}
org.apache.hc.core5.http2.H2ConnectionException: Frame size exceeds maximum
	at org.apache.hc.core5.http2.impl.nio.FrameInputBuffer.read(FrameInputBuffer.java:101)
	at org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.onInput(AbstractH2StreamMultiplexer.java:440)
	at org.apache.hc.core5.http2.impl.nio.AbstractH2IOEventHandler.inputReady(AbstractH2IOEventHandler.java:65)
	at org.apache.hc.core5.http2.impl.nio.ClientH2IOEventHandler.inputReady(ClientH2IOEventHandler.java:39)
	at org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:124)
	at org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:179)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:128)
	at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:85)
	at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
	at java.base/java.lang.Thread.run(Thread.java:834)
{code}
The complete session log can be found in the attachment [^hc5_session.log].



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org