You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/04/06 16:35:58 UTC

[GitHub] merlimat opened a new pull request #1321: Avoid contention on netty channel promise

merlimat opened a new pull request #1321: Avoid contention on netty channel promise
URL: https://github.com/apache/bookkeeper/pull/1321
 
 
   With profiler, I have seen there can be heavy contention between BK threads and Netty IO thread due the the checking for channel write condition that was recently added for monitoring purpose. 
   
   The problem relies in that there is one BK thread that is doing the `writeAndFlush()` on the PCBC and getting the `ChannelFuture`, adding a listener to the future. 
   
   The write operation, though, is completed in the Netty IO thread and the promise gets also triggered from that thread. So, there is contention between current thread adding the listener and the IO threads completing the promise. 
   
   If we add the listener before doing the write on channel, we can avoid the contention. Another option could be to do the write from the Netty IO thread as well.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services