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
Post a Comment