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

Mutiny is creating zombie thread on delayIt() which are not doing anything after certain time #1581

Open
mitkama opened this issue Apr 16, 2024 · 5 comments

Comments

@mitkama
Copy link

mitkama commented Apr 16, 2024

We have retry mechanism in our application which waits for some time (2 seconds) and then do the retry.

If we use this in our application throughput is getting dropped to absolute zero after 2 -3 days, thread are going into unresponsive state.

Attached screenshots of our JVM dashboard.

Code block which we have in our mutiny pipeline is as below.

return
          Uni.combine().all().unis(delayUni, refreshedCredentialsUni)
              .asTuple()
              .onItem()
              .delayIt()
              .by(Duration.ofSeconds(Math.min(backOffDuration, getMaxBackoff())))
              .onItem()
              .transformToUni(r -> cspResponseUni)

I have found similar thread here --> #786

@mitkama
Copy link
Author

mitkama commented Apr 16, 2024

Once we disable this delay, our throughput reduction problem is solved and we are not seeing this issue anymore.

But we need mechanism wherein the above code should work seam lessly.

@cescoffier
Copy link
Contributor

Are you running in Quarkus? There were a leak in the Jboss scheduler used in Quarkus.

As a workaround, you could define your own executor to execute the delay (instead of using the default one).

@mitkama
Copy link
Author

mitkama commented Apr 16, 2024

@cescoffier
Yes, we are running in Quarkus.

Despite supplying an external thread pool we are still observing the same behavior.

engineExecutorService = Executors .newFixedThreadPool(engineThreadPoolSize, new DefaultThreadFactory("worker"));

emitting on below thread pool

.emitOn(EngineThreadPool.getEngineExecutorService());

@cescoffier
Copy link
Contributor

Ah no, sorry, not using emitOn, but onItem().delayIt().on(executor).by(..)

@mitkama
Copy link
Author

mitkama commented Apr 16, 2024

@cescoffier

We haven't supplied an external pool in that pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants