Comments (6)
Setting -XX:ActiveProcessorCount=N
, instead of running in a docker container with cpu limit, produces the same results.
from quarkus.
Thanks for reporting.
I believe this is not a Quarkus issue
from quarkus.
Hi @geoand. Could you expand on that?
from quarkus.
We don't do anything specific for either the HTTP client or respond specifically to container limits.
I would suggest trying to reproduce something similar (essentially the executor not being taken into account) with plain Java
from quarkus.
I may be wrong, but the executor seems OK to me. From this code:
@PostConstruct
void createHttpClient() {
this.httpClient = HttpClient.newBuilder()
.executor(managedExecutor)
.version(HttpClient.Version.HTTP_2)
.build();
managedExecutor.supplyAsync(() -> "").thenApplyAsync(response -> {
Log.infof("PostConstruct thread=%s", Thread.currentThread().hashCode());
Log.infof("PostConstruct classLoaderAfter=%s", Thread.currentThread().getContextClassLoader());
return Thread.currentThread().getContextClassLoader().getClass().getName();
}, managedExecutor);
}
@GET
@Produces({MediaType.TEXT_PLAIN})
public CompletableFuture<String> test() {
URI uri = URI.create("http://www.columbia.edu/~fdc/sample.html");
HttpRequest request = HttpRequest.newBuilder().GET().uri(uri).build();
Log.infof("classLoaderBefore=%s", Thread.currentThread().getContextClassLoader());
return httpClient.sendAsync(request, HttpResponse.BodyHandlers.ofString()).thenApplyAsync(response -> {
Log.infof("thread=%s", Thread.currentThread().hashCode());
Log.infof("classLoaderAfter=%s", Thread.currentThread().getContextClassLoader());
return Thread.currentThread().getContextClassLoader().getClass().getName();
}, managedExecutor);
}
I get this log:
2024-06-23 08:46:15,765 INFO [ClassloadingResource] (executor-thread-1) PostConstruct thread=10217343
2024-06-23 08:46:15,765 INFO [ClassloadingResource] (executor-thread-1) PostConstruct classLoaderAfter=io.quarkus.bootstrap.runner.RunnerClassLoader@1
2024-06-23 08:46:15,766 INFO [ClassloadingResource] (vert.x-eventloop-thread-1) classLoaderBefore=io.quarkus.bootstrap.runner.RunnerClassLoader@1
2024-06-23 08:46:16,093 INFO [ClassloadingResource] (executor-thread-2) thread=1224931749
2024-06-23 08:46:16,094 INFO [ClassloadingResource] (executor-thread-2) classLoaderAfter=jdk.internal.loader.ClassLoaders$AppClassLoader@3d71d552
The thread appears to be from the managed executor.
The problem seems related to the classloader not being set/propagated on thread context.
Correct?
from quarkus.
This does seem like a real bug to me. Our thread pools should always be propagating the correct class loader, so it's odd that it's being erased somehow.
from quarkus.
Related Issues (20)
- `quarkus-quartz`: programmatic scheduling of async tasks with `jdbc-cmt` breaks application startup HOT 2
- Verification key is unresolvable HOT 5
- quarkus.rest-client.*.uri overrides almost all REST client URI configuration options HOT 3
- Unindexed qualifier throws NPE when ArcProcessor validates beans HOT 2
- DevUI: Endpoints error using Quarkus MyFaces extension (works in 3.8.4 LTS) HOT 5
- Native Build Fails, when Reusing Existing Executable with Compression Enabled HOT 1
- Multi Tenancy doesn't work properly HOT 3
- Resteasy tries to instantiate abstract classes since Quarkus 3.3 HOT 2
- Improve quarkus run command HOT 2
- [hibernate-search] Cannot inject CDI bean in `@SearchExtension` classes HOT 7
- Detected an instance of Random/SplittableRandom class in the image heap HOT 3
- Qute: make it possible to supply a template backed by a build item
- 3.8.4: quarkus.analytics.disabled ignored + command line answer not processed HOT 14
- Panache: MetaModel cannot determine ID field HOT 4
- JsonObject template extension for Qute built-in HOT 4
- Improve a build flow of a native image with input from an agent collecting data from JVM IT runs HOT 1
- WebSockets Next: document `WebSocket#inboundProcessingMode()`
- Do we need to update the "Security vulnerability detection and reporting" guide to focus more on CVE? HOT 2
- Reading manifest from jar in jar-based `PathTreeWithManifest` is suboptimal HOT 8
- Determine why we have entries in `java.beans.ThreadGroupContext` HOT 2
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 quarkus.