00853d9453
Motivation: In the early days of 5.0, we merged ChannelInboundHandler and ChannelOutboundHandler into ChannelHandler, and introduced the annotation called 'Skip'. The annotation 'Skip' was introduced to determine which handler methods are no-op (i.e. simply forwarding the event to the next handler) so that DefaultChannelHandlerContext doesn't even need to submit an event-invoking task to an EventExecutor, significantly reducing the context switches. However, this introduced a regression for the handlers which implemented write() but not flush(). Because flush() was skippable for such handlers, flush() event went through to the next handler before write() does. To address this problem, we came up with a naive workaround that sets MASK_FLUSH when MASK_WRITE is set. Although the previous workaround works fine for many cases, we still seem to have an event ordering problem. We keep seeing the intermittant failure of LocalTransportThreadModelTest.testStagedExecution(), because other handler methods are still skipped. Modifications: We do not skip the execution of handler methods annotated with 'Skip' unless all inbound methods (or all outbound methods) are marked with 'Skip'. Result: This change Brings back the event ordering behavior of 4.x, making LocalTransportThreadModelTest.testStagedExecution() pass. |
||
---|---|---|
.. | ||
src | ||
pom.xml |