markrmiller commented on issue #1261: HBASE-23952: Address thread safety issue 
with Map used in BufferCallB…
URL: https://github.com/apache/hbase/pull/1261#issuecomment-596869131
 
 
   I think the issue is that Netty can use different threads to access this 
data structure, ie:
   
   `    
   static void invokeUserEventTriggered(final AbstractChannelHandlerContext 
next, final Object event) {
           ObjectUtil.checkNotNull(event, "event");
           EventExecutor executor = next.executor();
           if (executor.inEventLoop()) {
               next.invokeUserEventTriggered(event);
           } else {
               executor.execute(new Runnable() {
                   @Override
                   public void run() {
                       next.invokeUserEventTriggered(event);
                   }
               });
           }
       }
   `
   
   If more than one thread is going to access a shared field, you have to 
publish it properly - either with memory barriers or it has to be final or 
effectively final. It seems very difficult to ensure that this is thread safe 
or will remain thread safe over time.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to