Mark connectionHandler as sharable (#1179)

Fixes #1170.

The reasoning for this PR is largely outlined in the above issue. As the ChannelInboundHandlerAdapter has no private class, a race condition cannot occur and therefore marking the class as sharable should incur no cost.
This commit is contained in:
Camotoy 2021-05-29 13:00:58 -04:00 committed by GitHub
parent 72c1f3e26c
commit 5acdb2b3c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -186,6 +186,12 @@ public class ProtocolInjector implements ChannelListener {
channel.pipeline().addFirst(beginInitProtocol);
ctx.fireChannelRead(msg);
}
@Override
public boolean isSharable() {
// Needed if multiple objects are stored in the bootstrap list
return true;
}
};
FuzzyReflection fuzzy = FuzzyReflection.fromObject(serverConnection, true);