quarkus: NPE in 2.9.1 Http2 response processing

Describe the bug

After upgrading from 2.8.3 to 2.9.1 we started seeing these errors in our logs.

Expected behavior

No errors

Actual behavior

java.lang.NullPointerException: Cannot invoke "io.vertx.core.Handler.handle(Object)" because "handler" is null
at io.vertx.core.http.impl.Http2ServerResponse.write(Http2ServerResponse.java:474)
at io.vertx.core.http.impl.Http2ServerResponse.end(Http2ServerResponse.java:433)
at io.vertx.core.http.impl.Http2ServerResponse.end(Http2ServerResponse.java:413)
at io.quarkus.vertx.http.runtime.filters.AbstractResponseWrapper.end(AbstractResponseWrapper.java:481)
at org.jboss.resteasy.reactive.server.vertx.VertxResteasyReactiveRequestContext.end(VertxResteasyReactiveRequestContext.java:331)
at org.jboss.resteasy.reactive.server.handlers.ResponseWriterHandler.handle(ResponseWriterHandler.java:38)
at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:114)
at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:141)
at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:550)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)

How to Reproduce?

It is intermittent and cannot reproduce outside of our production environment

Output of uname -a or ver

AWS Fargate

Output of java -version

OpenJDK Runtime Environment Temurin-17.0.2+8 (build 17.0.2+8)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.9.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (11 by maintainers)

Commits related to this issue

Most upvoted comments

@geoand it will work with 4.3.1, so you can revert it until quarkus uses 4.3.1 and we’re all happy 😃

@vietj

this was done recently (https://github.com/quarkusio/quarkus/pull/25577) and calling method with null is not something we advocate to do for most users.

I can understand why, but given that fire-and-forget seems to be missing gap in the API (or better- “explicit fire-and-forget”) and null isn’t a nice candidate for the callback-style API, wdyt about exposing a voidHandler-like singleton? I know in the past (thinking about Netty) it hasn’t been a great solution, making the underline stack more complex for what looks like a futile optimization, but saving a callback in the hot path means saving a whole graph of callbacks (including Netty ones) that interact with atomic/concurrent primitives too ie hurting not just the TLAB allocation machinery, but wasting CPU cycles as well.

I don’t really want to revert it. I did https://github.com/quarkusio/quarkus/pull/25684 instead.