Comments (6)
j.u.Timer
was introduced by #5372
/cc @zUniQueX
from jersey.
Or better: use a shared ScheduledThreadPoolExecutor
instead of Timer
from jersey.
@snazy Good catch. But I think your current implementation is also missing two aspects here:
- If Jetty's QTP utilizes all available processors for request handling and timeouts are frequent in some situation, the hard limit of the threads to a quarter of the available processors could lead to much higher timeouts. The delay in the
ScheduledExecutorService
is the minimum delay of the executor to wait before task execution, so the 'real' delay can be much higher. This wasn't a problem with theTimer
implementation because there the timeouts were all handled just when the timeout occurred. I think the executor's pool size should be adjusted relative to Jetty's QTP size. - If a request finishes in time, but some other requests are currently in timeout handling, the timeout task of the finished request will be kept in the executor's queue. The Jetty
Scheduler
implementation callssetRemoveOnCancelPolicy(true)
to overcome this problem.
Having that said, I'm thinking, if it would be a good idea to utilize Jetty's Scheduler
for the timeout handling. A Scheduler
instance can be obtained via request.getComponents().getScheduler()
.
from jersey.
Related Issues (20)
- Connectivity issues masked by ProcessingException: Already connected HOT 1
- IllegalAccessException in jersey-client-proxy when `@BeanParam` annotated class contains private fields
- ServletContext is invalid in MessageBodyWriter if handling async CompletionStage HOT 3
- Headers modified by MultiPartWriter are not sent HOT 2
- HttpUrlConnector and JettyConnector doesn't log the headers modified by MultiPartWriter HOT 2
- [Micrometer] suport for the @Counted annotation
- Wrong CDI-SE context is requested using jersey-media-jaxb versions 3.1.2 and higher running in a weld/grizzly container HOT 2
- jersey-netty-connector - Cancelling the future returned by rx() client does not terminate the request HOT 4
- Project Loom/JDK 21 compatible HOT 8
- Inquiry about Jersey Project Licensing and Third-Party Content Usage HOT 7
- jersey 3.1 default exception mapper message interferes with setStatusOverSendError=true
- [Feature request] Configuration options for multipart requests (Jersey 3.1.x) HOT 8
- `UriRoutingContext` may not log tracing events
- HttpUrlConnector to support domain fronting HOT 2
- Jersey 3.1.6 release HOT 2
- Jersey 3.0.x has no working provider that support Java 17, PATCH, and multipart attachments HOT 3
- JdkConnector does not properly cleanup ERROR state connections HOT 3
- NettyConnector does not respect timeouts HOT 7
- CVE-2023-4043 for jersey-media-json-binding dependency (parsson-1.1.1) 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 jersey.