You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2020/05/25 03:51:22 UTC

[GitHub] [avro] zeshuai007 commented on pull request #887: [AVRO-2806] Upgrade from Netty 3 -> Netty 4

zeshuai007 commented on pull request #887:
URL: https://github.com/apache/avro/pull/887#issuecomment-633362730


   Hi @dkulp ,
   
   Thanks to dkulp for solving this issue, it looks good.
   Before the last week, I almost finished the netty3-> 4 API upgrade and refactoring locally. At that time, my headache was the change of the netty3-4 thread model, which caused TestNetty4XServerConcurrentExecution to fail. Unfortunately, I have something else Blocked my refactoring process.
   So please forgive my recklessness, I hope to make a record here:
   1. Changed the package path in netty4.X, there is no jboss, because the author left the jboss company
   2. SimpleChannelUpstreamHandler-> SimpleChannelInboundHandler, deprecated channelOpen, use channelActive
   3. FrameDecoder-> ByteToMessageDecoder
   4. OneToOneEncoder-> MessageToMessageEncoder
   5, write-> writeAndFlush, netty4 separates write and flush, write is not processing flush
   6. NioServerSocketChannelFactory and NioClientSocketChannelFactory have been deprecated in netty 4.x. If there are no more complicated requirements in Netty 4.x, it is strongly recommended to use ServerBootstrap.channel (NioServerSocketChannel.class)
   7, netty4.x changed the thread model, Handler registered in ChannelPipeline is serial. The related processing of serialization should use the new NioEventLoop, isolated from the i / o thread, otherwise there will be unexpected results in some cases, such as thread blocking
   (The above is purely personal understanding, for reference only!)
   
   What I am still confused about is:
   addLast (new DefaultEventLoopGroup (n), new NettyServerAvroHandler ()) does not seem to work.
   Start a new thread in channelRead0
   TestNetty4XServerConcurrentExecution test passed


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org