Is Netty Channel.close() thread safe? -


i have netty server, need close request channel in thread. thread safe this? if not, there workaround solve it? suggestion appreciated!

btw, i'm using netty-4.0.34 nioeventloopgroup.

abstractchannelhandlercontext.java:514

    @override     public channelfuture close(final channelpromise promise) {     if (!validatepromise(promise, false)) {         // cancelled         return promise;     }      final abstractchannelhandlercontext next = findcontextoutbound();     eventexecutor executor = next.executor();     if (next.ishandleraddedcalled() && executor.ineventloop()) {         next.invokeclose(promise);     } else {         safeexecute(executor, new onetimetask() {             @override             public void run() {                 next.invokeclose(promise);             }         }, promise, null);     }      return promise; } 

if called in thread, io thread channel has stuck did closure, since 'executor.ineventloop()' false. interpretation true?

it thread safe, may trigger exceptions in pipeline , on client side if request in flight.


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -