Reduce chances of type check scalability issues (Fixes #5039) #5047
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is performing 2 changes:
eg
the entry in the issue
matches with https://github.com/netty/netty/blob/013c38298f6d28ec14543d02ede9bb6a6472ca3f/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java#L805
which
listeners
collections contains:meaning that the
checkcast
hidden in theArrayList::get(int)
(because of its generic type), will observe 4 different concrete types, causing thecheckcast
against to likely happen, although the JDK 22 JIT optimization mentioned at netty/netty#13745 (comment)ByteBuf
while reading the data passed by the pipeline, as reported byThe first is effective since netty/netty#13741 has already been merged and it removes the
ChannelInboundHandler
case in the report.With this PR there should be a single type check at
which won't flip-flop its type anymore, leveraging the existing
secondary_super_cache
value inVertxHttp2ConnectionHandler
'sKlass
.