| commit | de5271312abc8e070beedaed665a179ff810133f | [log] [tgz] |
|---|---|---|
| author | Robert Stupp <snazy@snazy.de> | Tue Apr 02 20:20:48 2024 +0200 |
| committer | jansupol <15908245+jansupol@users.noreply.github.com> | Thu Apr 04 10:14:55 2024 +0200 |
| tree | 5679644096aed2559958a955a49967c55e326a86 | |
| parent | d49a6021da350266e07de7bb880715e1910f86c0 [diff] |
Fix thread leak/invasion Jersey/Jetty, at least in the 3.1 version line, creates one thread for each HTTP request. This behavior was introduced with #5372 and seems not present in the 2.x or 3.x versions of Jersey. From the javadoc of `java.util.Timer`: ``` Implementation note: All constructors start a timer thread. ... After the last live reference to a Timer object goes away and all outstanding tasks have completed execution, the timer's task execution thread terminates gracefully (and becomes subject to garbage collection). However, this can take arbitrarily long to occur. ``` It is fair to assume that "arbitrarily long" may also mean _never_, in case GC never runs. This change replaces the timer & thread per request with a `ScheduledExecutorService` instance per `JettyHttpContainer`. Also changed the set-timeout mechanism to use `System.nanoTime()` instead of `System.currentTimeMillis()`, because the latter is prone to wall-clock drift and can result into wrong timeout values. Fixes #5588 Signed-off-by: Robert Stupp <snazy@snazy.de>
Jersey is a REST framework that provides JAX-RS Reference Implementation and more. Jersey provides its own APIs that extend the JAX-RS toolkit with additional features and utilities to further simplify RESTful service and client development. Jersey also exposes numerous extension SPIs so that developers may extend Jersey to best suit their needs.
Goals of Jersey project can be summarized in the following points:
Jersey is licensed under a dual license - EPL 2.0 and GPL 2.0 with Class-path Exception. That means you can choose which one of the two suits your needs better and use it under those terms.
We use contribution policy, which means we can only accept contributions under the terms of ECA.
See the Jersey website to access Jersey documentation. If you run into any issues or have questions, ask at jersey-dev@eclipse.org (need to subscribe first), StackOverflow or file an issue on Jersey GitHub Project. You can follow us on Twitter, too.