Replies: 1 comment 1 reply
-
|
Please ask this on the micronaut repo, not here. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have a microservices that uses micronaut-core 4.8.9 the uses micronaut-http-netty 4.8.9 and netty-codec-http2 4.1.118.Final. The Microservices is configured to call another backend service.
When stress testing the microservices, it makes a lot of calls to backend service through micronaut-http-netty and netty-codec-http2. I found the following error appears intermittently:
07:01:58.309 [default-nioEventLoopGroup-4-3] ERROR c.s.i.p.c.m.v.c.i.l.FrameworkLoggingService - EXC: [GET] /endpoint [f26a48a2-a972-4e82-b3c8-2fe70490976b] (S:2000000061:invite-services) [AP: 1je9us8c1pt0w, SI: 04087a28-3c33-4ad9-aed0-ae8699c5fa97] exception: 'HttpClientException (Client 'az-service': Error occurred reading HTTP response: Maximum active streams violated for this endpoint: 128)' that was caused by: io.netty.handler.codec.http2.Http2Exception.streamError(Http2Exception.java:151) "
The above exception is thrown at: https://github.com/netty/netty/blob/netty-4.1.118.Final/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java#L929
We are not sure the exception was thrown because "!isReserved && !canOpenStream()" OR "isReserved && numStreams >= maxStreams"
But generally we think by setting larger max streams would help, and like some guidance on how to set the proper configuration.
We also notice that in
https://github.com/micronaut-projects/micronaut-core/blob/v4.8.9/http-server-netty/src/test/groovy/io/micronaut/http/server/netty/configuration/NettyHttpServerConfigurationSpec.groovy#L448
When the test code sets the property
'micronaut.server.netty.http2.max-concurrent-streams': 100,
It would confirm the setting by
NettyHttpServerConfiguration config = beanContext.getBean(NettyHttpServerConfiguration)
And config.http2
Is io.netty.handler.codec.http2.Http2Settings class
https://github.com/netty/netty/blob/1a59152cbaa7f6bce77bbc6de652d868fcb0ff17/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Settings.java
We think Http2Settings.maxConcurrentStreams() is used to set DefaultHttp2Connection's maxActiveStreams property.
In short, we like some expert guidance on how to increase Netty's DefaultHttp2Connection's maxActiveStreams and maxStreams so that we can avoid setting the "Maximum active streams violated for this endpoint" error. Please advice.
Beta Was this translation helpful? Give feedback.
All reactions