[jira] [Commented] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum
[ https://issues.apache.org/jira/browse/HTTPCORE-707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17731627#comment-17731627 ] Lubos Husivarga commented on HTTPCORE-707: -- [~olegk] Yes you are right, I was looking at it from the wrong side. I will revert this change from my client and check if the server will still send the bigger frames. If yes, I will notify the server's owner to report a bug to a software he is using. I am sorry for the confusion, it's good to know where's the real issue now! Best Regards, Lubos > AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum > -- > > Key: HTTPCORE-707 > URL: https://issues.apache.org/jira/browse/HTTPCORE-707 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > Fix For: 5.1.4, 5.2-beta1 > > Attachments: context_wire_log.txt, http2_flow_frame.txt > > > AbstractH2StreamMultiplexer initializes outputBuffer with frame size from > local config: > _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, > this.{*}localConfig{*}.getMaxFrameSize());_ > > Data are streamed using streamData(...) method which checks maxPayloadSize > against remote config: > _final int maxPayloadSize = Math.min(capacity, > {*}remoteConfig{*}.getMaxFrameSize());_ > > Issue: When remote config has greater max frame size than local config and > the payload is also greater than local max frame size, the FrameOutputBuffer > throws "Frame size exceeds maximum" error, since it compares the payload size > against local frame size as it was initialized with it, not remote frame size. > > My suggestion: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) > should update the outputBuffer's max frame size based on remote config. > > I will appreciate your help, as it is really annoying issue depending on > remote site config and payload size, so it may be spotted randomly. -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Commented] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum
[ https://issues.apache.org/jira/browse/HTTPCORE-707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17731583#comment-17731583 ] Lubos Husivarga commented on HTTPCORE-707: -- [~olegk] that's interesting, but I am not so sure about it. In my case I was getting buffer overflow because the server's configuration for the frame was >64k and the server really sent a bigger frame. So I don't really agree with not expanding the buffer, because it will lead to the same error I had. The best approach here would be to expand the buffer right before the bigger frame arrives. What do you think? Thanks, Lubos > AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum > -- > > Key: HTTPCORE-707 > URL: https://issues.apache.org/jira/browse/HTTPCORE-707 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > Fix For: 5.1.4, 5.2-beta1 > > Attachments: context_wire_log.txt, http2_flow_frame.txt > > > AbstractH2StreamMultiplexer initializes outputBuffer with frame size from > local config: > _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, > this.{*}localConfig{*}.getMaxFrameSize());_ > > Data are streamed using streamData(...) method which checks maxPayloadSize > against remote config: > _final int maxPayloadSize = Math.min(capacity, > {*}remoteConfig{*}.getMaxFrameSize());_ > > Issue: When remote config has greater max frame size than local config and > the payload is also greater than local max frame size, the FrameOutputBuffer > throws "Frame size exceeds maximum" error, since it compares the payload size > against local frame size as it was initialized with it, not remote frame size. > > My suggestion: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) > should update the outputBuffer's max frame size based on remote config. > > I will appreciate your help, as it is really annoying issue depending on > remote site config and payload size, so it may be spotted randomly. -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Commented] (HTTPCLIENT-2212) AsyncClientEndpoint is not released upon lease failure
[ https://issues.apache.org/jira/browse/HTTPCLIENT-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17531915#comment-17531915 ] Lubos Husivarga commented on HTTPCLIENT-2212: - Tested and working fine. Thank you [~olegk] again for quick response and fix! All the best, Lubos > AsyncClientEndpoint is not released upon lease failure > -- > > Key: HTTPCLIENT-2212 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2212 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient (async) >Affects Versions: 5.1.3, 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > > When I use AsyncHttpClient and try to lease an endpoint to host > "https://localhost";, I receive javax.net.ssl.SSLHandshakeException exception > via callback's failed method. That's ok, because my localhost certificate is > not signed by authority. > The strange thing is that the endpoint is allocated from > PoolingAsyncClientConnectionManager, but not released after the connection > failure during the endpoint lease operation. > There is no way to release the endpoint from callback failed method, because > there is no reference to it. > Failing the lease multiple times consumes all available connections from > connection manager pool and any further lease operation remains in pending > state preventing any other connections to the host. > example: > > {code:java} > httpManager = PoolingAsyncClientConnectionManagerBuilder.create() > .setDefaultConnectionConfig(ConnectionConfig.custom() > .setTimeToLive(TimeValue.NEG_ONE_MILLISECOND) //TTL is > maximum time one connection can be used, > //then it is closed and new one is opened. Therefore > -1 disables TTL and same connection lasts until > //it is actively used. Then closed by > IdleConnectionEvictor thread. > .build()) > .setDefaultTlsConfig(TlsConfig.custom() > .setVersionPolicy(HttpVersionPolicy.NEGOTIATE) > .build()) > .build(); > httpClient = HttpAsyncClients.createMinimal( > H2Config.DEFAULT, > Http1Config.DEFAULT, > IOReactorConfig.DEFAULT, > httpManager); > httpClient.start(); > > HttpHost host = new HttpHost("https", "localhost", 443); > httpClient.lease(host, new FutureCallback() { > @Override > public void failed(Exception ex) { > } > > @Override > public void completed(AsyncClientEndpoint result) > { > } > > @Override > public void cancelled() { > } > }); > > Set routes = httpManager.getRoutes(); > List stats = new ArrayList(routes.size()); > > for(HttpRoute route : routes){ > PoolStats s = httpManager.getStats(route); > System.out.println(route.getTargetHost().getHostName()); > System.out.println(s.getAvailable()); > System.out.println(s.getLeased()); > System.out.println(s.getMax()); > System.out.println(s.getPending()); > } > {code} > -- This message was sent by Atlassian Jira (v8.20.7#820007) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Created] (HTTPCORE-712) AsyncClientEndpoint is not released upon lease failure
Lubos Husivarga created HTTPCORE-712: Summary: AsyncClientEndpoint is not released upon lease failure Key: HTTPCORE-712 URL: https://issues.apache.org/jira/browse/HTTPCORE-712 Project: HttpComponents HttpCore Issue Type: Bug Components: HttpCore NIO Affects Versions: 5.2-alpha1 Reporter: Lubos Husivarga When I use AsyncHttpClient and try to lease an endpoint to host "https://localhost";, I receive javax.net.ssl.SSLHandshakeException exception via callback's failed method. That's ok, because my localhost certificate is not signed by authority. The strange thing is that the endpoint is allocated from PoolingAsyncClientConnectionManager, but not released after the connection failure during the endpoint lease operation. There is no way to release the endpoint from callback failed method, because there is no reference to it. Failing the lease multiple times consumes all available connections from connection manager pool and any further lease operation remains in pending state preventing any other connections to the host. example: {code:java} httpManager = PoolingAsyncClientConnectionManagerBuilder.create() .setDefaultConnectionConfig(ConnectionConfig.custom() .setTimeToLive(TimeValue.NEG_ONE_MILLISECOND) //TTL is maximum time one connection can be used, //then it is closed and new one is opened. Therefore -1 disables TTL and same connection lasts until //it is actively used. Then closed by IdleConnectionEvictor thread. .build()) .setDefaultTlsConfig(TlsConfig.custom() .setVersionPolicy(HttpVersionPolicy.NEGOTIATE) .build()) .build(); httpClient = HttpAsyncClients.createMinimal( H2Config.DEFAULT, Http1Config.DEFAULT, IOReactorConfig.DEFAULT, httpManager); httpClient.start(); HttpHost host = new HttpHost("https", "localhost", 443); httpClient.lease(host, new FutureCallback() { @Override public void failed(Exception ex) { } @Override public void completed(AsyncClientEndpoint result) { } @Override public void cancelled() { } }); Set routes = httpManager.getRoutes(); List stats = new ArrayList(routes.size()); for(HttpRoute route : routes){ PoolStats s = httpManager.getStats(route); System.out.println(route.getTargetHost().getHostName()); System.out.println(s.getAvailable()); System.out.println(s.getLeased()); System.out.println(s.getMax()); System.out.println(s.getPending()); } {code} -- This message was sent by Atlassian Jira (v8.20.7#820007) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Commented] (HTTPCORE-708) AbstractH2StreamMultiplexer: FrameInputBuffer: java.nio.BufferOverflowException
[ https://issues.apache.org/jira/browse/HTTPCORE-708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17499219#comment-17499219 ] Lubos Husivarga commented on HTTPCORE-708: -- [~olegk] thank you for this one, I am already testing it. So far it works well, no exceptions thrown. I will keep an eye on your future changes and test them as well. Big thanks for your contribution to this amazing library, it rocks! Lubos > AbstractH2StreamMultiplexer: FrameInputBuffer: > java.nio.BufferOverflowException > --- > > Key: HTTPCORE-708 > URL: https://issues.apache.org/jira/browse/HTTPCORE-708 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > Fix For: 5.1.4, 5.2-alpha3 > > Attachments: BufferOverflowException.txt > > > I am experiencing BufferOverflowException when GETting file from URL. The > issue can be easily reproduced using [AsyncClientHttpExchange > example|https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientHttpExchange.java] > and this image URL: > [https://burst.shopifycdn.com/photos/centered-car-driving-through-forest.jpg?width=1442&format=pjpg&exif=0&iptc=0] > > stacktrace: > Caused by: java.nio.BufferOverflowException > at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:213) > at > org.apache.hc.core5.http2.impl.nio.FrameInputBuffer.put(FrameInputBuffer.java:89) > at > org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.onInput(AbstractH2StreamMultiplexer.java:437) > 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.ssl.SSLIOSession.decryptData(SSLIOSession.java:594) > at > org.apache.hc.core5.reactor.ssl.SSLIOSession.access$200(SSLIOSession.java:73) > at > org.apache.hc.core5.reactor.ssl.SSLIOSession$1.inputReady(SSLIOSession.java:201) > at > org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:140) > at > org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51) > at > org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:178) > at > org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127) > at > org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:85) > at > org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44) > at java.lang.Thread.run(Thread.java:748) > > Debug Log using categories: [^BufferOverflowException.txt] > log4j.category.org.apache.hc.client5.http2=debug > log4j.category.org.apache.hc.client5.http2.frame=debug > log4j.category.org.apache.hc.client5.http2.frame.payload=debug > > Thank you for any idea! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Commented] (HTTPCORE-708) AbstractH2StreamMultiplexer: FrameInputBuffer: java.nio.BufferOverflowException
[ https://issues.apache.org/jira/browse/HTTPCORE-708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17498562#comment-17498562 ] Lubos Husivarga commented on HTTPCORE-708: -- Hi [~olegk], that's great you write at least some of them, I never do :x Do you already have some fix? I can't wait for it to test it. Thank you! Lubos > AbstractH2StreamMultiplexer: FrameInputBuffer: > java.nio.BufferOverflowException > --- > > Key: HTTPCORE-708 > URL: https://issues.apache.org/jira/browse/HTTPCORE-708 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > Fix For: 5.1.4, 5.2-alpha3 > > Attachments: BufferOverflowException.txt > > > I am experiencing BufferOverflowException when GETting file from URL. The > issue can be easily reproduced using [AsyncClientHttpExchange > example|https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientHttpExchange.java] > and this image URL: > [https://burst.shopifycdn.com/photos/centered-car-driving-through-forest.jpg?width=1442&format=pjpg&exif=0&iptc=0] > > stacktrace: > Caused by: java.nio.BufferOverflowException > at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:213) > at > org.apache.hc.core5.http2.impl.nio.FrameInputBuffer.put(FrameInputBuffer.java:89) > at > org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.onInput(AbstractH2StreamMultiplexer.java:437) > 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.ssl.SSLIOSession.decryptData(SSLIOSession.java:594) > at > org.apache.hc.core5.reactor.ssl.SSLIOSession.access$200(SSLIOSession.java:73) > at > org.apache.hc.core5.reactor.ssl.SSLIOSession$1.inputReady(SSLIOSession.java:201) > at > org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:140) > at > org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51) > at > org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:178) > at > org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127) > at > org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:85) > at > org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44) > at java.lang.Thread.run(Thread.java:748) > > Debug Log using categories: [^BufferOverflowException.txt] > log4j.category.org.apache.hc.client5.http2=debug > log4j.category.org.apache.hc.client5.http2.frame=debug > log4j.category.org.apache.hc.client5.http2.frame.payload=debug > > Thank you for any idea! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Commented] (HTTPCORE-708) AbstractH2StreamMultiplexer: FrameInputBuffer: java.nio.BufferOverflowException
[ https://issues.apache.org/jira/browse/HTTPCORE-708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17498148#comment-17498148 ] Lubos Husivarga commented on HTTPCORE-708: -- Thank you [~olegk] It looks like race condition to me, let's see what's your findings. Fingers crossed! Lubos > AbstractH2StreamMultiplexer: FrameInputBuffer: > java.nio.BufferOverflowException > --- > > Key: HTTPCORE-708 > URL: https://issues.apache.org/jira/browse/HTTPCORE-708 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > Fix For: 5.1.4, 5.2-alpha3 > > Attachments: BufferOverflowException.txt > > > I am experiencing BufferOverflowException when GETting file from URL. The > issue can be easily reproduced using [AsyncClientHttpExchange > example|https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientHttpExchange.java] > and this image URL: > [https://burst.shopifycdn.com/photos/centered-car-driving-through-forest.jpg?width=1442&format=pjpg&exif=0&iptc=0] > > stacktrace: > Caused by: java.nio.BufferOverflowException > at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:213) > at > org.apache.hc.core5.http2.impl.nio.FrameInputBuffer.put(FrameInputBuffer.java:89) > at > org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.onInput(AbstractH2StreamMultiplexer.java:437) > 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.ssl.SSLIOSession.decryptData(SSLIOSession.java:594) > at > org.apache.hc.core5.reactor.ssl.SSLIOSession.access$200(SSLIOSession.java:73) > at > org.apache.hc.core5.reactor.ssl.SSLIOSession$1.inputReady(SSLIOSession.java:201) > at > org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:140) > at > org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51) > at > org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:178) > at > org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127) > at > org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:85) > at > org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44) > at java.lang.Thread.run(Thread.java:748) > > Debug Log using categories: [^BufferOverflowException.txt] > log4j.category.org.apache.hc.client5.http2=debug > log4j.category.org.apache.hc.client5.http2.frame=debug > log4j.category.org.apache.hc.client5.http2.frame.payload=debug > > Thank you for any idea! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Created] (HTTPCORE-708) AbstractH2StreamMultiplexer: FrameInputBuffer: java.nio.BufferOverflowException
Lubos Husivarga created HTTPCORE-708: Summary: AbstractH2StreamMultiplexer: FrameInputBuffer: java.nio.BufferOverflowException Key: HTTPCORE-708 URL: https://issues.apache.org/jira/browse/HTTPCORE-708 Project: HttpComponents HttpCore Issue Type: Bug Components: HttpCore NIO Affects Versions: 5.2-alpha1 Reporter: Lubos Husivarga Attachments: BufferOverflowException.txt I am experiencing BufferOverflowException when GETting file from URL. The issue can be easily reproduced using [AsyncClientHttpExchange example|https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientHttpExchange.java] and this image URL: [https://burst.shopifycdn.com/photos/centered-car-driving-through-forest.jpg?width=1442&format=pjpg&exif=0&iptc=0] stacktrace: Caused by: java.nio.BufferOverflowException at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:213) at org.apache.hc.core5.http2.impl.nio.FrameInputBuffer.put(FrameInputBuffer.java:89) at org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.onInput(AbstractH2StreamMultiplexer.java:437) 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.ssl.SSLIOSession.decryptData(SSLIOSession.java:594) at org.apache.hc.core5.reactor.ssl.SSLIOSession.access$200(SSLIOSession.java:73) at org.apache.hc.core5.reactor.ssl.SSLIOSession$1.inputReady(SSLIOSession.java:201) at org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:140) at org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51) at org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:178) at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127) at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:85) at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44) at java.lang.Thread.run(Thread.java:748) Debug Log using categories: [^BufferOverflowException.txt] log4j.category.org.apache.hc.client5.http2=debug log4j.category.org.apache.hc.client5.http2.frame=debug log4j.category.org.apache.hc.client5.http2.frame.payload=debug Thank you for any idea! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Commented] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum
[ https://issues.apache.org/jira/browse/HTTPCORE-707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17467460#comment-17467460 ] Lubos Husivarga commented on HTTPCORE-707: -- [~olegk] I have already tested and it works well now. Issue can be closed from my point of view, thanks! Lubos > AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum > -- > > Key: HTTPCORE-707 > URL: https://issues.apache.org/jira/browse/HTTPCORE-707 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > Fix For: 5.1.4, 5.2-alpha3 > > Attachments: context_wire_log.txt, http2_flow_frame.txt > > > AbstractH2StreamMultiplexer initializes outputBuffer with frame size from > local config: > _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, > this.{*}localConfig{*}.getMaxFrameSize());_ > > Data are streamed using streamData(...) method which checks maxPayloadSize > against remote config: > _final int maxPayloadSize = Math.min(capacity, > {*}remoteConfig{*}.getMaxFrameSize());_ > > Issue: When remote config has greater max frame size than local config and > the payload is also greater than local max frame size, the FrameOutputBuffer > throws "Frame size exceeds maximum" error, since it compares the payload size > against local frame size as it was initialized with it, not remote frame size. > > My suggestion: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) > should update the outputBuffer's max frame size based on remote config. > > I will appreciate your help, as it is really annoying issue depending on > remote site config and payload size, so it may be spotted randomly. -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Commented] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum
[ https://issues.apache.org/jira/browse/HTTPCORE-707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17467448#comment-17467448 ] Lubos Husivarga commented on HTTPCORE-707: -- Thanks [~olegk] ! I didn't expect the buffer can be expanded in such a simple way, I wasn't sure about thread safety. I have put a breakpoint at the buffer expansion point and no other requests were processed, so looks thread safe for me. One more line is missing in the expand(...) method of FrameOutputBuffer, you didn't update the maxFramePayloadSize and therefore the exception is thrown anyway, please update your commit: {code:java} public void expand(final int maxFramePayloadSize) { + this.maxFramePayloadSize = maxFramePayloadSize; final ByteBuffer newBuffer = ByteBuffer.allocate(FrameConsts.HEAD_LEN + maxFramePayloadSize); if (buffer.position() > 0) { buffer.flip(); newBuffer.put(buffer); } buffer = newBuffer; } {code} Otherwise it seems to work well, but the higher frame size did not help with file upload performance much in my case :( Thank you very much for your quick response and fix, I didn't expect it! Keep up the great work and Happy New Year! > AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum > -- > > Key: HTTPCORE-707 > URL: https://issues.apache.org/jira/browse/HTTPCORE-707 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > Fix For: 5.1.4, 5.2-alpha3 > > Attachments: context_wire_log.txt, http2_flow_frame.txt > > > AbstractH2StreamMultiplexer initializes outputBuffer with frame size from > local config: > _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, > this.{*}localConfig{*}.getMaxFrameSize());_ > > Data are streamed using streamData(...) method which checks maxPayloadSize > against remote config: > _final int maxPayloadSize = Math.min(capacity, > {*}remoteConfig{*}.getMaxFrameSize());_ > > Issue: When remote config has greater max frame size than local config and > the payload is also greater than local max frame size, the FrameOutputBuffer > throws "Frame size exceeds maximum" error, since it compares the payload size > against local frame size as it was initialized with it, not remote frame size. > > My suggestion: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) > should update the outputBuffer's max frame size based on remote config. > > I will appreciate your help, as it is really annoying issue depending on > remote site config and payload size, so it may be spotted randomly. -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Updated] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum
[ https://issues.apache.org/jira/browse/HTTPCORE-707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lubos Husivarga updated HTTPCORE-707: - Attachment: http2_flow_frame.txt > AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum > -- > > Key: HTTPCORE-707 > URL: https://issues.apache.org/jira/browse/HTTPCORE-707 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > Attachments: context_wire_log.txt, http2_flow_frame.txt > > > AbstractH2StreamMultiplexer initializes outputBuffer with frame size from > local config: > _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, > this.{*}localConfig{*}.getMaxFrameSize());_ > > Data are streamed using streamData(...) method which checks maxPayloadSize > against remote config: > _final int maxPayloadSize = Math.min(capacity, > {*}remoteConfig{*}.getMaxFrameSize());_ > > Issue: When remote config has greater max frame size than local config and > the payload is also greater than local max frame size, the FrameOutputBuffer > throws "Frame size exceeds maximum" error, since it compares the payload size > against local frame size as it was initialized with it, not remote frame size. > > My suggestion: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) > should update the outputBuffer's max frame size based on remote config. > > I will appreciate your help, as it is really annoying issue depending on > remote site config and payload size, so it may be spotted randomly. -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Commented] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum
[ https://issues.apache.org/jira/browse/HTTPCORE-707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17467231#comment-17467231 ] Lubos Husivarga commented on HTTPCORE-707: -- Hi [~olegk] You are right about the spec, but not about the HttpClient behaviour. The frame exceeded exception is thrown when HttpClient is sending a second frame of my POST operation and the stacktrace confirms this: {*}FrameOutputBuffer.write{*}(RawFrame, WritableByteChannel) line: 70 ClientH2StreamMultiplexer(AbstractH2StreamMultiplexer).{*}streamDataFrame{*}(int, AtomicInteger, ByteBuffer, int) line: 342 ClientH2StreamMultiplexer(AbstractH2StreamMultiplexer).{*}streamData{*}(int, AtomicInteger, ByteBuffer) line: 363 AbstractH2StreamMultiplexer.access$11(AbstractH2StreamMultiplexer, int, AtomicInteger, ByteBuffer) line: 345 AbstractH2StreamMultiplexer$H2StreamChannelImpl.write(ByteBuffer) line: 1424 ClientH2StreamHandler$1.write(ByteBuffer) line: 92 The bug can be spotted directly from constructor of AbstractH2StreamMultiplexer, where the outputBuffer is instantiated with localConfig (which is default and defines max frame size as 65536) and method org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.streamData(int, AtomicInteger, ByteBuffer) where the payload is divided into frames, but now based on remoteConfig (where the server defined max frame size as 16777215). This is the place where the frame size is calculated incorrectly and the second frame size in my case was calculated as 98295 bytes. When streamDataFrame(...) is called and tries to write to outputBuffer, the Frame size exceeded exception is thrown, because the buffer was instantiated with 65536 size. When I simply replace remoteConfig with localConfig in org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.{*}streamData{*}(int, AtomicInteger, ByteBuffer): - final int maxPayloadSize = Math.min(capacity, {*}remoteConfig{*}.getMaxFrameSize()); + final int maxPayloadSize = Math.min(capacity, {*}localConfig{*}.getMaxFrameSize()); it all works, but I am limited with small frame size, since the remote config is not affecting the outputBuffer :( This means I will send bigger payloads (binary files) slower than server can handle due to small outputBuffer size on client side. I believe org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(H2Config) method should enlarge the outputBuffer when it receives the remote config from remote side to enable HttpClient to send bigger frames and use full capabilities of the server. Here is the log which looks much better. I have removed the raw data output with ... [^http2_flow_frame.txt] > AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum > -- > > Key: HTTPCORE-707 > URL: https://issues.apache.org/jira/browse/HTTPCORE-707 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > Attachments: context_wire_log.txt, http2_flow_frame.txt > > > AbstractH2StreamMultiplexer initializes outputBuffer with frame size from > local config: > _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, > this.{*}localConfig{*}.getMaxFrameSize());_ > > Data are streamed using streamData(...) method which checks maxPayloadSize > against remote config: > _final int maxPayloadSize = Math.min(capacity, > {*}remoteConfig{*}.getMaxFrameSize());_ > > Issue: When remote config has greater max frame size than local config and > the payload is also greater than local max frame size, the FrameOutputBuffer > throws "Frame size exceeds maximum" error, since it compares the payload size > against local frame size as it was initialized with it, not remote frame size. > > My suggestion: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) > should update the outputBuffer's max frame size based on remote config. > > I will appreciate your help, as it is really annoying issue depending on > remote site config and payload size, so it may be spotted randomly. -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Commented] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum
[ https://issues.apache.org/jira/browse/HTTPCORE-707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17467014#comment-17467014 ] Lubos Husivarga commented on HTTPCORE-707: -- Hi [~olegk] I have produced full wire and context log, but I don't find it helpful. I do multiple exchanges before the exchange ex-07 which fails with frame size exceeded error. [^context_wire_log.txt] The log does not trace remote config setting which is: [headerTableSize=4096, pushEnabled=true, maxConcurrentStreams=256, initialWindowSize=65536, {*}maxFrameSize{*}=16777215, maxHeaderListSize=2147483647, compressionEnabled=true] Exception's stack trace is here: Daemon Thread [httpclient-dispatch-1] (Suspended (breakpoint at line 70 in FrameOutputBuffer)) FrameOutputBuffer.write(RawFrame, WritableByteChannel) line: 70 ClientH2StreamMultiplexer(AbstractH2StreamMultiplexer).streamDataFrame(int, AtomicInteger, ByteBuffer, int) line: 342 ClientH2StreamMultiplexer(AbstractH2StreamMultiplexer).streamData(int, AtomicInteger, ByteBuffer) line: 363 AbstractH2StreamMultiplexer.access$11(AbstractH2StreamMultiplexer, int, AtomicInteger, ByteBuffer) line: 345 AbstractH2StreamMultiplexer$H2StreamChannelImpl.write(ByteBuffer) line: 1424 ClientH2StreamHandler$1.write(ByteBuffer) line: 92 LoggingAsyncClientExchangeHandler$1.write(ByteBuffer) line: 102 BasicAsyncEntityProducer.produce(DataStreamChannel) line: 129 SimpleRequestProducer(BasicRequestProducer).produce(DataStreamChannel) line: 104 BasicClientExchangeHandler.produce(DataStreamChannel) line: 91 LoggingAsyncClientExchangeHandler.produce(DataStreamChannel) line: 90 ClientH2StreamHandler.produceOutput() line: 172 AbstractH2StreamMultiplexer$H2Stream.produceOutput() line: 1620 ClientH2StreamMultiplexer(AbstractH2StreamMultiplexer).produceOutput() line: 1176 ClientH2StreamMultiplexer(AbstractH2StreamMultiplexer).onOutput() line: 474 ClientH2IOEventHandler(AbstractH2IOEventHandler).outputReady(IOSession) line: 74 ClientH2IOEventHandler.outputReady(IOSession) line: 39 SSLIOSession.encryptData(IOSession) line: 633 SSLIOSession.access$400(SSLIOSession, IOSession) line: 73 SSLIOSession$1.outputReady(IOSession) line: 207 InternalDataChannel.onIOEvent(int) line: 150 InternalDataChannel(InternalChannel).handleIOEvent(int) line: 51 SingleCoreIOReactor.processEvents(Set) line: 178 SingleCoreIOReactor.doExecute() line: 127 SingleCoreIOReactor(AbstractSingleCoreIOReactor).execute() line: 85 IOReactorWorker.run() line: 44 Thread.run() line: 748 In my use case I create the HTTP Client like this: _httpManager = PoolingAsyncClientConnectionManagerBuilder.create()_ _.setDefaultConnectionConfig(ConnectionConfig.custom()_ _.setTimeToLive(TimeValue.NEG_ONE_MILLISECOND)_ _.build())_ _.setDefaultTlsConfig(TlsConfig.custom()_ _.setVersionPolicy(HttpVersionPolicy.FORCE_HTTP_2)_ _.build())_ _.build();_ _httpClient = HttpAsyncClients.createMinimal(_ _H2Config.DEFAULT,_ _Http1Config.DEFAULT,_ _IOReactorConfig.DEFAULT,_ _httpManager);_ _httpClient.start();_ Then I lease an endpoint and execute HttpPost built like this: _endpoint = httpClient.lease(host, callback);_ _SimpleHttpRequest post = SimpleRequestBuilder.post("/v2/file")_ _.setHttpHost(host)_ _.addHeader("Authorization", "Bearer " + request.mondayAccessToken)_ _.addHeader(ctHeader.getName(), ctHeader.getValue())_ _.setBody(baos.toByteArray(), ContentType.MULTIPART_FORM_DATA)_ _.build();_ _endpoint.execute(SimpleRequestProducer.create(post),_ _SimpleResponseConsumer.create(),_ _callback);_ Size of POST body is: 179517 FrameOutputBuffer's maxFramePayloadSize is: 65536 Hope it helps, let me know any thoughts and thanks in advance! > AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum > -- > > Key: HTTPCORE-707 > URL: https://issues.apache.org/jira/browse/HTTPCORE-707 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > Attachments: context_wire_log.txt > > > AbstractH2StreamMultiplexer initializes outputBuffer with fram
[jira] [Updated] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum
[ https://issues.apache.org/jira/browse/HTTPCORE-707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lubos Husivarga updated HTTPCORE-707: - Attachment: context_wire_log.txt > AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum > -- > > Key: HTTPCORE-707 > URL: https://issues.apache.org/jira/browse/HTTPCORE-707 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > Attachments: context_wire_log.txt > > > AbstractH2StreamMultiplexer initializes outputBuffer with frame size from > local config: > _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, > this.{*}localConfig{*}.getMaxFrameSize());_ > > Data are streamed using streamData(...) method which checks maxPayloadSize > against remote config: > _final int maxPayloadSize = Math.min(capacity, > {*}remoteConfig{*}.getMaxFrameSize());_ > > Issue: When remote config has greater max frame size than local config and > the payload is also greater than local max frame size, the FrameOutputBuffer > throws "Frame size exceeds maximum" error, since it compares the payload size > against local frame size as it was initialized with it, not remote frame size. > > My suggestion: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) > should update the outputBuffer's max frame size based on remote config. > > I will appreciate your help, as it is really annoying issue depending on > remote site config and payload size, so it may be spotted randomly. -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Updated] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum
[ https://issues.apache.org/jira/browse/HTTPCORE-707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lubos Husivarga updated HTTPCORE-707: - Attachment: (was: context_wire_log.txt) > AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum > -- > > Key: HTTPCORE-707 > URL: https://issues.apache.org/jira/browse/HTTPCORE-707 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > > AbstractH2StreamMultiplexer initializes outputBuffer with frame size from > local config: > _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, > this.{*}localConfig{*}.getMaxFrameSize());_ > > Data are streamed using streamData(...) method which checks maxPayloadSize > against remote config: > _final int maxPayloadSize = Math.min(capacity, > {*}remoteConfig{*}.getMaxFrameSize());_ > > Issue: When remote config has greater max frame size than local config and > the payload is also greater than local max frame size, the FrameOutputBuffer > throws "Frame size exceeds maximum" error, since it compares the payload size > against local frame size as it was initialized with it, not remote frame size. > > My suggestion: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) > should update the outputBuffer's max frame size based on remote config. > > I will appreciate your help, as it is really annoying issue depending on > remote site config and payload size, so it may be spotted randomly. -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Updated] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum
[ https://issues.apache.org/jira/browse/HTTPCORE-707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lubos Husivarga updated HTTPCORE-707: - Attachment: context_wire_log.txt > AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum > -- > > Key: HTTPCORE-707 > URL: https://issues.apache.org/jira/browse/HTTPCORE-707 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > Attachments: context_wire_log.txt > > > AbstractH2StreamMultiplexer initializes outputBuffer with frame size from > local config: > _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, > this.{*}localConfig{*}.getMaxFrameSize());_ > > Data are streamed using streamData(...) method which checks maxPayloadSize > against remote config: > _final int maxPayloadSize = Math.min(capacity, > {*}remoteConfig{*}.getMaxFrameSize());_ > > Issue: When remote config has greater max frame size than local config and > the payload is also greater than local max frame size, the FrameOutputBuffer > throws "Frame size exceeds maximum" error, since it compares the payload size > against local frame size as it was initialized with it, not remote frame size. > > My suggestion: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) > should update the outputBuffer's max frame size based on remote config. > > I will appreciate your help, as it is really annoying issue depending on > remote site config and payload size, so it may be spotted randomly. -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Updated] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum
[ https://issues.apache.org/jira/browse/HTTPCORE-707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lubos Husivarga updated HTTPCORE-707: - Description: AbstractH2StreamMultiplexer initializes outputBuffer with frame size from local config: _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, this.{*}localConfig{*}.getMaxFrameSize());_ Data are streamed using streamData(...) method which checks maxPayloadSize against remote config: _final int maxPayloadSize = Math.min(capacity, {*}remoteConfig{*}.getMaxFrameSize());_ Issue: When remote config has greater max frame size than local config and the payload is also greater than local max frame size, the FrameOutputBuffer throws "Frame size exceeds maximum" error, since it compares the payload size against local frame size as it was initialized with it, not remote frame size. My suggestion: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) should update the outputBuffer's max frame size based on remote config. I will appreciate your help, as it is really annoying issue depending on remote site config and payload size, so it may be spotted randomly. was: AbstractH2StreamMultiplexer initializes outputBuffer with frame size from local config: _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, this.{*}localConfig{*}.getMaxFrameSize());_ Data are streamed using streamData(...) method which checks maxPayloadSize against remote config: _final int maxPayloadSize = Math.min(capacity, {*}remoteConfig{*}.getMaxFrameSize());_ Issue: When remote config has greater max frame size than local config and the payload is also greater than local max frame size, the FrameOutputBuffer throws "Frame size exceeds maximum" error, since it compares the payload size against local frame size as it was initialized with it, not remote frame size. My solution: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) updates the outputBuffer's max frame size based on remote config. Since FrameOutputBuffer has the max frame size property final, I had to remove the final. Not sure whether it could break something later on :) I will appreciate any better solution to this, as it is really annoying issue depending on remote site config and payload size, so may be spotted randomly. > AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum > -- > > Key: HTTPCORE-707 > URL: https://issues.apache.org/jira/browse/HTTPCORE-707 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO >Affects Versions: 5.2-alpha1 >Reporter: Lubos Husivarga >Priority: Major > > AbstractH2StreamMultiplexer initializes outputBuffer with frame size from > local config: > _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, > this.{*}localConfig{*}.getMaxFrameSize());_ > > Data are streamed using streamData(...) method which checks maxPayloadSize > against remote config: > _final int maxPayloadSize = Math.min(capacity, > {*}remoteConfig{*}.getMaxFrameSize());_ > > Issue: When remote config has greater max frame size than local config and > the payload is also greater than local max frame size, the FrameOutputBuffer > throws "Frame size exceeds maximum" error, since it compares the payload size > against local frame size as it was initialized with it, not remote frame size. > > My suggestion: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) > should update the outputBuffer's max frame size based on remote config. > > I will appreciate your help, as it is really annoying issue depending on > remote site config and payload size, so it may be spotted randomly. -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org
[jira] [Created] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum
Lubos Husivarga created HTTPCORE-707: Summary: AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum Key: HTTPCORE-707 URL: https://issues.apache.org/jira/browse/HTTPCORE-707 Project: HttpComponents HttpCore Issue Type: Bug Components: HttpCore NIO Affects Versions: 5.2-alpha1 Reporter: Lubos Husivarga AbstractH2StreamMultiplexer initializes outputBuffer with frame size from local config: _this.outputBuffer = new FrameOutputBuffer(this.outputMetrics, this.{*}localConfig{*}.getMaxFrameSize());_ Data are streamed using streamData(...) method which checks maxPayloadSize against remote config: _final int maxPayloadSize = Math.min(capacity, {*}remoteConfig{*}.getMaxFrameSize());_ Issue: When remote config has greater max frame size than local config and the payload is also greater than local max frame size, the FrameOutputBuffer throws "Frame size exceeds maximum" error, since it compares the payload size against local frame size as it was initialized with it, not remote frame size. My solution: AbstractH2StreamMultiplexer.{*}applyRemoteSettings{*}(...) updates the outputBuffer's max frame size based on remote config. Since FrameOutputBuffer has the max frame size property final, I had to remove the final. Not sure whether it could break something later on :) I will appreciate any better solution to this, as it is really annoying issue depending on remote site config and payload size, so may be spotted randomly. -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org