Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Uncaught exception received by Vert.x: java.lang.IllegalStateException: Result is already complete - possibly in VertxRequestWriteSubscriber #43399

Closed
jsx000 opened this issue Dec 13, 2024 · 2 comments · Fixed by #43402
Assignees
Labels
Azure.Core azure-core customer-reported Issues that are reported by GitHub users external to the Azure organization. HttpClient question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@jsx000
Copy link

jsx000 commented Dec 13, 2024

Describe the bug
We have a Java application that is part of an "upload to Azure" flow. The uploader is a distinct component and is deployed to a Kubernetes cluster. The uploader, in current testing, is uploading to Azurite. We are conducting stress tests and I observed exactly 4 times, within about a 75 minute window, the below exception. It appeared immediately after a new upload was started. All 4 of these instances were uploading a 10mb file on the heels of either a 1mb, 10mb or 100mb file (roughly, by our logging). The upload still succeeded, which is important to note - there isn't an obvious failure - but as we continue testing and moving to higher environments, we need a degree of confidence there is no lurking issue here.

I fear there's some hard to characterize interaction between Apache Camel, Quarkus, Netty, Vert.x and the Azure library, perhaps a subtle race condition.

As the VertxRequestWriteSubscriber looks like a possible source of the exception, or at least a participant, I am filing this issue here in hopes someone can help confirm whether it's an actual issue or something safe to ignore.

We are not setting any properties specific to vert.x and do not have any custom code related to vert.x directly.
 
Thanks in advance.

Exception or Stack Trace
[io.qua.ver.cor.run.VertxCoreRecorder] (vert.x-eventloop-thread-0) Uncaught exception received by Vert.x: java.lang.IllegalStateException: Result is already complete
at io.vertx.core.Promise.fail(Promise.java:90)
at com.azure.core.http.vertx.implementation.VertxRequestWriteSubscriber.resetRequest(VertxRequestWriteSubscriber.java:137)
at com.azure.core.http.vertx.implementation.VertxRequestWriteSubscriber.lambda$write$1(VertxRequestWriteSubscriber.java:104)
at io.vertx.core.impl.future.FutureImpl$4.onFailure(FutureImpl.java:188)
at io.vertx.core.impl.future.FutureBase.lambda$emitFailure$1(FutureBase.java:75)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at [email protected]/java.lang.Thread.runWith(Thread.java:1596)
at [email protected]/java.lang.Thread.run(Thread.java:1583)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:896)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:872)

To Reproduce
I have not been able to reproduce this in a minimal project.

Code Snippet
N/A

Expected behavior
The exception should not occur, or if it does, extra information should be provided to make it clear whether the exception must be handled or if it is safe to ignore.

Screenshots
N/A

Setup (please complete the following information):
- OS: RHEL 8.9 / Kubernetes
- IDE: VSCode
- Library/Libraries:

      io.quarkus.platform:quarkus-bom:3.15.1
      io.quarkus.platform:quarkus-camel-bom:3.15.1
      io.quarkus.platform:quarkus-amazon-services-bom:3.15.1
      io.quarkiverse.azureservices:quarkus-azure-services-bom:1.0.7
      com.google.guava:guava:33.2.1-jre
      org.projectlombok:lombok:1.18.32
      org.apache.commons:commons-compress:1.26.2

      via boms:
         org.apache.camel.quarkus:camel-quarkus-seda
         org.apache.camel.quarkus:camel-quarkus-log
         org.apache.camel.quarkus:camel-quarkus-netty
         org.apache.camel.quarkus:camel-quarkus-bean
         io.quarkus:quarkus-arc
         io.quarkus:quarkus-jaxb
         io.quarkus:quarkus-container-image-jib
         software.amazon.awssdk:netty-nio-client
         org.apache.camel.quarkus:camel-quarkus-direct

      build plugins:
         org.apache.maven.plugins:maven-compiler-plugin:3.13.0
         org.jboss.jandex:jandex-maven-plugin:1.2.3
         maven-surefire-plugin:3.3.0
         maven-failsafe-plugin:3.3.0
         org.apache.maven.plugins:maven-pmd-plugin:3.23.0

- Java version: 17.0.13
- App Server/Environment: Kubernetes hosted Java application compiled under Quarkus/Graal to run natively
- Frameworks: Apache Camel, Quarkus, Netty, Vert.X, Azure Library

- verbose dependency tree (mvn dependency:tree -Dverbose)
see attached
verbose_dependencies.txt

exception message, full stack trace, and any available logs
[io.qua.ver.cor.run.VertxCoreRecorder] (vert.x-eventloop-thread-0) Uncaught exception received by Vert.x: java.lang.IllegalStateException: Result is already complete
see above for full stack trace

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [v] Bug Description Added
  • [n/a] Repro Steps Added
  • [v] Setup information Added
@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 13, 2024
@alzimmermsft alzimmermsft self-assigned this Dec 13, 2024
@github-actions github-actions bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Dec 13, 2024
@alzimmermsft
Copy link
Member

alzimmermsft commented Dec 13, 2024

Thanks for filing this @jsx000!

I took a look into VertxRequestWriteSubscriber and it appears possible for this to happen if the Promise we're using in VertxRequestWriteSubscriber is failed or completed externally of VertxRequestWriteSubscriber which results in the call to Promise.fail(Throwable) throwing an exception.

I've filed this PR to harden functionality: #43402

@jsx000
Copy link
Author

jsx000 commented Dec 13, 2024

Thanks for the swift triage and action!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core azure-core customer-reported Issues that are reported by GitHub users external to the Azure organization. HttpClient question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants