tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: tomcat 8.5.23 can not modify maxconcurrentstream setting
Date Fri, 01 Mar 2019 09:44:29 GMT
On 27/02/2019 08:37, Helena Carbajo wrote:
>>> See
>>> https://github.com/apache/tomcat/blob/8.5.x/test/org/apache/coyote/http2/TestHttp2Section_5_1.java#L174
> 
> From what I see in the test a STREAM_REFUSED is returned when a the maxConcurrentStream
 is set to one. Yet I'd like to understand how this value is changed internally. I think the
only difference with my code is the call to the method doHttpUpgrade() which seems to send
a GET for upgrade. Does this perform the actual upgrade of the settings? If this is the case
where is it implemented?

Http2UpgradeHandler (which represents an HTTP/2 connection) sets the
maximum concurrent stream value when the connection is created:

https://github.com/apache/tomcat/blob/master/java/org/apache/coyote/http2/Http2UpgradeHandler.java#L156

This means if the value set on the protocol is changed dynamically, the
new value takes effect for all subsequent connections.

The setting is communicated to the client as part of the connection preface.

https://github.com/apache/tomcat/blob/master/java/org/apache/coyote/http2/Http2UpgradeHandler.java#L229

Well-behaved clients will respect this setting but Tomcat checks the
limit every time a new stream is created.

https://github.com/apache/tomcat/blob/master/java/org/apache/coyote/http2/Http2UpgradeHandler.java#L1333

You may find enabling Tomcat's debug logging for HTTP/2 instructive.

Mark


> 
> -----Original Message-----
> From: Mark Thomas <markt@apache.org> 
> Sent: martes, 26 de febrero de 2019 13:45
> To: users@tomcat.apache.org
> Subject: Re: tomcat 8.5.23 can not modify maxconcurrentstream setting
> 
> See
> https://github.com/apache/tomcat/blob/8.5.x/test/org/apache/coyote/http2/TestHttp2Section_5_1.java#L174
> 
> Mark
> 
> 
> On 26/02/2019 11:01, Helena Carbajo wrote:
>> I'm trying to modify the value of MaxConcurrentStream for the tomcat server in order
to check that it returns a STREAM_REFUSED when the client uses more streams, but I don't manage
to change the default unlimited value.
>>
>> I've been inspecting the tomcat server code with a debugger and I saw it enters the
method protected synchronized void set(Setting setting, Long value)  from the org.apache.coyote.http2.ConnectionSettingsLocal.java
class to change the value for maxConcurrentStream. Yet, if I'm not wrong, it only modifies
the pending hashSet not the current one, which is the one that is checked later on to determine
if it is lower than the clients' active streams and therefore send the  STREAM_REFUSED code.
>>
>>
>>
>> I'm not sure if  I'm not modifying the value correctly. I use the Http2Protocol's
method setMaxConcurrentStreams to set the value and then add the Http2Protocol to the connector(addUpgradeProtocol).
>>
>>
>>
>> I'd be grateful if someone could give me a hint of what is going on or what I'm doing
wrong. Thank you!
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message