diff --git a/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java index fc928761c8..cbc631ffc7 100644 --- a/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java +++ b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java @@ -1559,6 +1559,7 @@ public class DefaultChannelPipeline implements ChannelPipeline { public final void run() { try { runTask(); + } catch (Throwable t) { if (t instanceof ChannelException) { cause = (ChannelException) t; @@ -1577,7 +1578,9 @@ public class DefaultChannelPipeline implements ChannelPipeline { void await() { try { - wait(); + synchronized (ChannelPipelineModificationRunnable.this) { + wait(); + } if (cause != null) { throw cause; }