[jira] [Commented] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum

2023-06-14 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on HTTPCORE-707:
--

Commit 3ab9d95da1a828da32246facd03aec44f30a7201 in httpcomponents-core's branch 
refs/heads/master from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=3ab9d95da ]

HTTPCORE-751: H2 protocol handler always resizes the output frame buffer to the 
remove MAX_FRAME_SIZE instead of doing so only then the remote MAX_FRAME_SIZE 
is lesser than the current MAX_FRAME_SIZE (partially reverts HTTPCORE-707)


> 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

2023-06-13 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on HTTPCORE-707:
--

Commit ed61f0e62053d3953fb33bf655e1af0cb7f59988 in httpcomponents-core's branch 
refs/heads/dependabot/maven/io.reactivex.rxjava3-rxjava-3.1.6 from Oleg 
Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=ed61f0e62 ]

HTTPCORE-751: H2 protocol handler always resizes the output frame buffer to the 
remove MAX_FRAME_SIZE instead of doing so only then the remote MAX_FRAME_SIZE 
is lesser than the current MAX_FRAME_SIZE (partially reverts HTTPCORE-707)


> 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

2023-06-13 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on HTTPCORE-707:
--

Commit ed61f0e62053d3953fb33bf655e1af0cb7f59988 in httpcomponents-core's branch 
refs/heads/master from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=ed61f0e62 ]

HTTPCORE-751: H2 protocol handler always resizes the output frame buffer to the 
remove MAX_FRAME_SIZE instead of doing so only then the remote MAX_FRAME_SIZE 
is lesser than the current MAX_FRAME_SIZE (partially reverts HTTPCORE-707)


> 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

2023-06-13 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on HTTPCORE-707:
--

Commit 9af8e78a495a15202c29235ac310e9f2408eba8e in httpcomponents-core's branch 
refs/heads/master from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=9af8e78a4 ]

HTTPCORE-751: H2 protocol handler always resizes the output frame buffer to the 
remove MAX_FRAME_SIZE instead of doing so only then the remote MAX_FRAME_SIZE 
is lesser than the current MAX_FRAME_SIZE (partially reverts HTTPCORE-707)


> 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

2023-06-12 Thread Lubos Husivarga (Jira)


[ 
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

2023-06-12 Thread Oleg Kalnichevski (Jira)


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

Oleg Kalnichevski commented on HTTPCORE-707:


> The best approach here would be to expand the buffer right before the bigger 
> frame arrives. What do you think?

[~lhusivarga] I think this is wrong. If one wants larger MAX_FRAME_SIZE one 
_MUST_ set it _locally_ and the remote endpoint _NEEDS_ to acknowledge it. I 
suspect that whatever software you application was communicating with was 
incorrectly sending larger frames than those communicated by the client 
endpoint with the SETTINGS frame in a violation of the H2 protocol.

Oleg

> 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

2023-06-12 Thread Lubos Husivarga (Jira)


[ 
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] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum

2023-06-12 Thread Oleg Kalnichevski (Jira)


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

Oleg Kalnichevski commented on HTTPCORE-707:


[~lhusivarga] I looks like we (I especially) made a mistake. Please see 
HTTPCORE-751. It am afraid I will have to revert the behavior introduced 
through this ticket.

Oleg

> 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

2022-10-02 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on HTTPCORE-707:
--

Commit b2a5a1810ec1876fa1246d0f6362f7b0bf2d6a9b in httpcomponents-core's branch 
refs/heads/github_ci_on_win from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=b2a5a1810 ]

HTTPCORE-707: H2 connections incorrectly enforce the frame size max limit based 
on local settings instead of remote ones


> 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

2022-01-01 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on HTTPCORE-707:
--

Commit a3c77ef69d4449881a55f43d600e40029a2ee6fd in httpcomponents-core's branch 
refs/heads/master from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=a3c77ef ]

HTTPCORE-707: H2 connections incorrectly enforce the frame size max limit based 
on local settings instead of remote ones


> 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

2022-01-01 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on HTTPCORE-707:
--

Commit b2a5a1810ec1876fa1246d0f6362f7b0bf2d6a9b in httpcomponents-core's branch 
refs/heads/5.1.x from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=b2a5a18 ]

HTTPCORE-707: H2 connections incorrectly enforce the frame size max limit based 
on local settings instead of remote ones


> 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

2022-01-01 Thread Lubos Husivarga (Jira)


[ 
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

2022-01-01 Thread Oleg Kalnichevski (Jira)


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

Oleg Kalnichevski commented on HTTPCORE-707:


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

[~lhusivarga] My bad. Corrected. Please do another pass.

> I didn't expect the buffer can be expanded in such a simple way, I wasn't 
> sure about thread safety. 

I/O buffers are not thread safe by design but any interaction with them takes 
place within a session lock. Thread-safety should not be an issue.

Oleg

> 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

2022-01-01 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on HTTPCORE-707:
--

Commit e1c2e70810fb2f92a10efa63329a5a6c73b6a165 in httpcomponents-core's branch 
refs/heads/HTTPCORE-707 from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=e1c2e70 ]

HTTPCORE-707: H2 connections incorrectly enforce the frame size max limit based 
on local settings instead of remote ones


> 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

2022-01-01 Thread Lubos Husivarga (Jira)


[ 
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] [Commented] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum

2021-12-31 Thread Oleg Kalnichevski (Jira)


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

Oleg Kalnichevski commented on HTTPCORE-707:


[~lhusivarga] Please review / test the proposed fix:
https://github.com/apache/httpcomponents-core/tree/HTTPCORE-707

Oleg

> 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

2021-12-31 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on HTTPCORE-707:
--

Commit cf2ad36fccc93fdd989523b213f161307e0cc094 in httpcomponents-core's branch 
refs/heads/HTTPCORE-707 from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=cf2ad36 ]

HTTPCORE-707: H2 connections incorrectly enforce the frame size max limit based 
on local settings instead of remote ones


> 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

2021-12-31 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on HTTPCORE-707:
--

Commit 8a754f9e48738343acc6471cdaabce04e36f71fb in httpcomponents-core's branch 
refs/heads/5.1.x from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=8a754f9 ]

HTTPCORE-707: H2 connections incorrectly enforce the frame size max limit based 
on local settings instead of remote ones


> 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

2021-12-31 Thread Oleg Kalnichevski (Jira)


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

Oleg Kalnichevski commented on HTTPCORE-707:


[~lhusivarga] Ok. I see the problem. In fact FrameOutputBuffer is not even 
supposed to meddle with the frame max size limit or enforce any other protocol 
level rules. 

Oleg

> 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

2021-12-31 Thread Lubos Husivarga (Jira)


[ 
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

2021-12-31 Thread Oleg Kalnichevski (Jira)


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

Oleg Kalnichevski commented on HTTPCORE-707:


[~lhusivarga] Here's the problem. Based on my reading of the HTTP/2 spec the 
opposite endpoint is not supposed to send frames larger than what the local 
endpoint is willing to accept. I will do another scan through the relevant 
sections of the specification but so far the behavior of HttpClient looks 
correct. If the client has specified the max frame size it is willing to work 
with during the SETTING handshake the server may not send frames with size 
larger than the max size specified by the client. The server can however 
indicate that it can handle different (larger) frames if the client is capable 
of generating them.

The log is not terribly helpful as it is missing HTTP/2 specific details. 
Please re-run the same test with the following log priorities and attache the 
resultant log
{noformat}



{noformat}

Oleg  

> 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] [Commented] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum

2021-12-30 Thread Lubos Husivarga (Jira)


[ 
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] [Commented] (HTTPCORE-707) AbstractH2StreamMultiplexer: FrameOutputBuffer: Frame size exceeds maximum

2021-12-30 Thread Oleg Kalnichevski (Jira)


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

Oleg Kalnichevski commented on HTTPCORE-707:


[~lhusivarga] Could you please generate a full wire / context log of the 
session [1] exhibiting the problem including the exception stack trace and 
attach it here?

Oleg

[1] https://hc.apache.org/httpcomponents-client-5.1.x/logging.html

> 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