bookkeeper icon indicating copy to clipboard operation
bookkeeper copied to clipboard

why BookieNettyServer’s parentGroup and childGroup is same EventLoopGroup?

Open luoxn28 opened this issue 7 years ago • 4 comments

QUESTION as code, If use independent EventLoopGroup, connect event and write/read event don't interact other. so, why BookieNettyServer’s parentGroup and childGroup is same EventLoopGroup?

private void listenOn(InetSocketAddress address, BookieSocketAddress bookieAddress) throws InterruptedException {
        if (!conf.isDisableServerSocketBind()) {
            ServerBootstrap bootstrap = new ServerBootstrap();
            bootstrap.option(ChannelOption.ALLOCATOR, allocator);
            bootstrap.childOption(ChannelOption.ALLOCATOR, allocator);
            bootstrap.group(eventLoopGroup, eventLoopGroup); // <-----
// ...

Looking forward to your reply, thans.

luoxn28 avatar May 28 '19 08:05 luoxn28

@luoxn28 since the bookie is implemented in asynchronous way, I don't think it really matter if using two separate EventLoopGroup.

sijie avatar May 28 '19 09:05 sijie

@sijie You're right, using an EventGroupLoop doesn't make much of a difference, especially in an asynchronous way, which makes little difference to the client.But it's better to use a different EventGroupLoop for isolation.

luoxn28 avatar May 28 '19 13:05 luoxn28

@luoxn28 agreed. Are you interested in contributing a feature to add an option to make it able to configure using a different EventGroupLoop for isolation?

sijie avatar Jul 21 '19 07:07 sijie

closed by #3153

hezhangjian avatar Apr 11 '24 06:04 hezhangjian