-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Description
I modified code that depends on grpc-java to use the unpooled allocator type for netty. In order to accomplish this I had to:
- Pass in
unpooledfor theio.netty.allocator.typeproperty. See https://github.com/netty/netty/blob/4.1/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L78 - Pass in
falsefor theio.grpc.netty.useCustomAllocatorproperty. I am usingv1.32.1but this also applies to the latest versionv1.56.x. See https://github.com/grpc/grpc-java/blob/v1.32.x/netty/src/main/java/io/grpc/netty/Utils.java#L126 and https://github.com/grpc/grpc-java/blob/v1.56.x/netty/src/main/java/io/grpc/netty/Utils.java#L136
Why is the default value for io.grpc.netty.useCustomAllocator true? In order for the code to use the ByteBufAllocator.DEFAULT the io.grpc.netty.useCustomAllocator property must be overridden to false, which seems to contradict the idea of a default. Would it make more sense for io.grpc.netty.useCustomAllocator to default to false so that ByteBufAllocator.DEFAULT is used by default?
I am asking because I had to do some debugging to figure out why only supplying io.netty.allocator.type=unpooled did not change the allocator type as I had expected. Thanks!
Reactions are currently unavailable