lhotari commented on issue #14436:
URL: https://github.com/apache/pulsar/issues/14436#issuecomment-1064908704


   > @lhotari do you mean it's a netty issue ? Should we report it to the netty 
commuinty and revert the netty version ?
   
   No it's not a Netty issue. It's a problem caused by our code in Pulsar and 
Bookkeeper violating the Java Memory Model and thread safety rules.
   
   There are 2 possible solutions:
   
   1) Disabling the Netty Recycler by setting 
`Dio.netty.recycler.maxCapacityPerThread=0`. There are early reports from 
@dave2wave in OMB testing that when running on JDK17 ZGC or Shenandoah GC, 
there's no negative performance impact in disabling Netty Recycler. 
   
   2) Making the recycled object instances thread safe. There are multiple ways 
to achieve this.
   I'm thinking of an approach where there would be a base class for recycled 
objects with methods that should be called after writing fields and before 
reading fields in different threads. That would be sufficient to ensure thread 
safety without the need to have full synchronization. It could be implemented 
with a simple volatile field write and read.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to