[jira] [Resolved] (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:all-tabpanel
 ]

Oleg Kalnichevski resolved HTTPCORE-707.

Resolution: Fixed

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