[ 
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-0000000007 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<T>.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<SelectionKey>) 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 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

Reply via email to