Comments (6)
I believe we should start to provide different examples when the code is started from a non vertx thread, e.g.
vertx.deployVerticle(...).await();
would make sense to me
- it forces the main thread to await the success or failure of the deployment
- it will allow event-loop to be started and prevent the exit
However await()
currently is only supported on worker threads, but it would make sense to support it from a non vertx event-loop thread.
from vert.x.
Quick analysis: when the virtual thread model is used, no event loop is created before the http server is started. Vert.x threads are non-daemon by default, and they prevent the JVM from shutting down.
In the sample before, the application reaches the end of the main method before the virtual thread triggers the creation of the http server.
That is why the JVM shut downs early.
from vert.x.
cc @vietj
Many applications rely on the fact that the JVM will stay alive even after the main thread reaches the end of the method.
from vert.x.
yeah I found this issue too a while ago, I don't know yet what is the best way to address it.
I believe that applications should not rely on vertx though
from vert.x.
I just found that this (funny?) behavior:
vertx.deployVerticle(new MainVerticle(), deploymentOptions)
to:
vertx.deployVerticle(MainVerticle.class.getName(), deploymentOptions)
Then the JVM doesn't stop because Vert.x starts an event loop
I believe that applications should not rely on vertx though
I understand. On the other hand, we have so many examples which look like the example in the description.
from vert.x.
Perhaps we can find the difference between deploying a verticle with a class name or with a class or an instance, and make sure it always works like deploying using a class name.
from vert.x.
Related Issues (20)
- Failure to decode JsonObject or JsonArray if Jackson Databind Scala module is registered
- Rename Buffer toJson method to toJsonElement
- The minimum required version of the JDK should be 11, and not 1.8
- Metrics for Prometheus doesn't work when using Vert.x launcher HOT 3
- Optimize Http 2 header validation
- Pool metrics not appearing HOT 1
- WebSocket client does not set underlying connection's error handler resulting in an unwanted error log HOT 1
- Memory Leak related to io.netty.util.concurrent.FastThreadLocal in Vertx code HOT 6
- Expose containsValue method on the MultiMap interface
- vertx-core has an implicit build time dependency to verx-codegen (under specific circumstances) HOT 1
- handle of SNI has a problem HOT 1
- Support IPv6 and IPv4 dual-stack network listening HOT 3
- Add setDefaultServer toHttpClientOptions HOT 1
- Inconsistency in pooled-but-unused TCP connection error between Windows and Linux/MacOs HOT 4
- vertx-core jar quarantined due to incorrect CVE vulnerability by Sonatype HOT 7
- Verticle getting deployed in Event Model when its setup for Worker Model using Deployment Options. HOT 2
- Update Netty version to allow retries with TCP on timeout HOT 2
- Reduce the number of eventloops started by default HOT 3
- SIGSEGV during SSL.freeSSL when multiple instances are deployed HOT 1
- WebClient through kerberos secured proxy is not working HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vert.x.