Expected behavior
When Http3FrameCodec is installed with an EventExecutorGroup, QPACK read resumption and buffered-write draining should execute on ChannelHandlerContext.executor() before accessing codec state, the pipeline, or the pending-write queue.
Actual behavior
The listeners registered with QpackAttributes.whenDecoderStreamAvailable(...) and whenEncoderStreamAvailable(...) execute their resume/drain logic directly on the thread that completes the corresponding future.
If that future is completed outside the executor assigned to Http3FrameCodec, codec state and pipeline operations are accessed from the wrong executor. A deterministic test records that read resumption is not running in ctx.executor().
I have not tied this to the unrelated DBeaver/native-QUIC problem reported in #17041. This report is specifically about handler-executor affinity in the HTTP/3 QPACK resumption callbacks.
Steps to reproduce
- Create a
DefaultEventExecutorGroup(1).
- Install
Http3FrameCodec using pipeline.addLast(executorGroup, codec).
- Delay creation of the QPACK decoder stream so that
ReadResumptionListener registers with whenDecoderStreamAvailable(...).
- Complete the decoder-stream future outside the handler executor.
- Observe the executor from which the codec receives the empty-buffer read used to resume decoding.
The assertion below fails with the current direct-callback behavior:
assertTrue(resumedOnHandlerExecutor.get());
Scheduling through the context executor makes the same test pass:
if (ctx.executor().inEventLoop()) {
resume();
} else {
ctx.executor().execute(this);
}
The equivalent executor handoff is also needed before draining buffered writes.
Minimal yet complete reproducer code (or URL to code)
A deterministic regression test and proposed fix are available in PR #17232. The test is named Http3FrameCodecTest.testReadResumptionUsesHandlerExecutor in the updated local branch and will be pushed to the PR.
The essential setup is:
EventExecutorGroup executor = new DefaultEventExecutorGroup(1);
AtomicBoolean resumedOnHandlerExecutor = new AtomicBoolean();
// Install a spy of Http3FrameCodec using pipeline.addLast(executor, codec).
// When channelRead(ctx, Unpooled.EMPTY_BUFFER) is called, record:
resumedOnHandlerExecutor.set(executor.next().inEventLoop());
// Ensure handlerAdded has run, then complete the decoder-stream future
// from the test thread and assert the recorded value is true.
Netty version
4.2.18.Final-SNAPSHOT.
JVM version (e.g. java -version)
Eclipse Temurin OpenJDK 21.0.11+10.
OS version (e.g. uname -a)
Microsoft Windows NT 10.0.26300.0.
netty-http3-qpack-executor-reproducer.zip