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

Don't let potential failures in message consumers cause dev mode shutdown to be blocked permanently #16253

Merged
merged 1 commit into from
Apr 8, 2021

Conversation

jaikiran
Copy link
Member

@jaikiran jaikiran commented Apr 6, 2021

The commit here makes sure that the unregisterMessageConsumers counts down the latch irrespective of whether or not the message consumer failed. Additionally, a failure of the message consumer to unregister is now logged (at WARN) during the shutdown.

While I was at this, I noticed that the registration of these message consumers too had a potential to block forever awaiting a latch countdown, if the message consumer fails for whatever reason. So I've updated that part of the code too, to count down the latch irrespective of whether or not the registration failed. A failure to register is then thrown back as an exception to prevent the deployment from succeeding.

@quarkus-bot
Copy link

quarkus-bot bot commented Apr 6, 2021

Test Failures

⚙️ jvm-linux-jdk11

📦 extensions/mongodb-client/deployment

# Tests:    11
+ Success:  10
- Failures: 0
- Errors:   1
! Skipped:  0
io.quarkus.mongodb.LegacyNamedMongoClientConfigTest - see on GitHub
java.util.concurrent.RejectedExecutionException
	at org.jboss.threads.RejectingExecutor.execute(RejectingExecutor.java:38)
	at org.jboss.threads.EnhancedQueueExecutor.rejectShutdown(EnhancedQueueExecutor.java:2045)
	at org.jboss.threads.EnhancedQueueExecutor.execute(EnhancedQueueExecutor.java:767)
	at io.smallrye.mutiny.infrastructure.MutinyScheduler$DecoratedRunnableTask.run(MutinyScheduler.java:58)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
	Suppressed: java.util.concurrent.RejectedExecutionException: Executor is being shut down
		at org.jboss.threads.EnhancedQueueExecutor.rejectShutdown(EnhancedQueueExecutor.java:2047)
		... 5 more

Copy link
Contributor

@mkouba mkouba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@jaikiran
Copy link
Member Author

jaikiran commented Apr 6, 2021

I've updated the commit message and the PR description to remove references to #16230, since although this PR does fix a potential issue, it may not fix what's described in that issue, for reasons noted in #16230 (comment)

@mkouba mkouba added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Apr 6, 2021
@jaikiran jaikiran merged commit 6a6f82b into quarkusio:main Apr 8, 2021
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone Apr 8, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants