Fix possible deadlock in DefaultChannelPipeline.destroyDown(...)
Motivation: We need to ensure we not hold a lock while executor callHandlerRemoved(...) as this may lead to a deadlock if handlerRemoved(...) will call another method in DEfaultChannelPipeline from another thread that will need to obtain the lock as well and wait for the result. Modifications: Release the lock before call handlerRemoved0(...). Result: No more deadlock possible
This commit is contained in:
parent
f8b306f61c
commit
e847ac0443
@ -858,8 +858,8 @@ public class DefaultChannelPipeline implements ChannelPipeline {
|
|||||||
if (inEventLoop || executor.inEventLoop(currentThread)) {
|
if (inEventLoop || executor.inEventLoop(currentThread)) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
remove0(ctx);
|
remove0(ctx);
|
||||||
callHandlerRemoved0(ctx);
|
|
||||||
}
|
}
|
||||||
|
callHandlerRemoved0(ctx);
|
||||||
} else {
|
} else {
|
||||||
final AbstractChannelHandlerContext finalCtx = ctx;
|
final AbstractChannelHandlerContext finalCtx = ctx;
|
||||||
executor.execute(new OneTimeTask() {
|
executor.execute(new OneTimeTask() {
|
||||||
|
Loading…
Reference in New Issue
Block a user