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
Warn about usage of Quarkus#blockingExit on the main thread #28939
Conversation
This comment has been minimized.
This comment has been minimized.
StartupActionImpl#runMainClassBlocking which is used for @QuarkusMainTest was incorrectly called on the main thread before this change.
I had to add another test to fix how the exit method was being called for tests. @stuartwdouglas you might want to take a look |
Failing Jobs - Building 04652b7
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 11 Windows #- Failing: extensions/vertx/deployment
! Skipped: extensions/agroal/deployment extensions/amazon-lambda-http/deployment extensions/amazon-lambda-rest/deployment and 340 more 📦 extensions/vertx/deployment✖
⚙️ JVM Tests - JDK 17 #- Failing: devtools/cli
📦 devtools/cli✖
✖
✖
|
@@ -182,6 +183,12 @@ public static void waitForExit() { | |||
* Must not be called by the main thread, or a deadlock will result. | |||
*/ | |||
public static void blockingExit() { | |||
if (Thread.currentThread().getThreadGroup().getName().equals("main") && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will be ok. If we get reports of false positives though we should probably move it to some kind of ThreadLocal marker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely
Relates to: #28899