Commit Graph

218 Commits

Author SHA1 Message Date
Lachlan Roberts 3d28e16a84
changes from review
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-08-22 13:03:01 +10:00
Lachlan Roberts e11120c3d1
Issue #6328 - avoid binding WebSocket MethodHandles
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-08-21 10:51:16 +10:00
Joakim Erdfelt af23f51d92
Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.1.x 2024-06-19 16:18:15 -05:00
Greg Wilkins 95059356c9
Fix contains in HttpFields name set and prove random access to HttpFields via EnumMap not worth it. (#11846)
Fix #11811 with javadoc and  benchmark
2024-06-19 09:32:49 +10:00
Olivier Lamy fb1697fd07
Updating to version 12.0.11-SNAPSHOT 2024-05-30 15:23:16 +10:00
Olivier Lamy 26106dfc84
Updating to version 12.0.10 2024-05-30 14:39:40 +10:00
Joakim Erdfelt 8e7e42201a
Updating to version 12.0.10-SNAPSHOT 2024-05-03 09:28:36 -04:00
Joakim Erdfelt efe8023327
Updating to version 12.0.9 2024-05-03 09:02:37 -04:00
gregw b11996a3c4 Introduced EE11 and jetty-12.1.x 2024-04-26 22:42:57 +10:00
Joakim Erdfelt 4cc938429f
Issue #11648 - Introducing HttpDateTime class. (#11672)
+ Introduces HTTP (and Cookie) Date/Time parsing
  according to spec algorithms.
+ Introduces formatting according to spec
  mandated preferred RFC 1123 format.
+ Deprecate DateParser
2024-04-23 17:17:59 -05:00
Joakim Erdfelt b3ef872d6b
Updating to version 12.0.9-SNAPSHOT 2024-03-29 15:20:11 -05:00
Joakim Erdfelt ffffdcc3c8
Updating to version 12.0.8 2024-03-29 14:31:57 -05:00
Greg Wilkins 51fc906d37
Optimized ReservedThreadExecutor with ThreadIdPool (#11498)
* Introduced ThreadIdPool and replaced ThreadLocal with it
 * Modified ReservedThreadExecutor to be backed by a ThreadIdPool of semaphores

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: gregw <gregw@webtide.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2024-03-21 16:53:14 +01:00
Joakim Erdfelt 369d9f7e2f
Merge remote-tracking branch 'origin/release/12.0.7' into jetty-12.0.x 2024-03-06 11:00:50 -06:00
Greg Wilkins 80f912a121
Improve HTTP parsing long look-ahead (#11486)
Use ByteBuffer.getLong to look for entire request (GET / HTTP/1.1) or response (HTTP/1.1 200 OK) line with 2 long lookups.  Failing that, a single long lookup is sufficient to determine the common methods and/or HttpVersion.

* Cleanup generator also

* Added a fallback int lookup
2024-03-05 17:34:14 +01:00
Joakim Erdfelt 18b2a7c201
Updating to version 12.0.8-SNAPSHOT 2024-02-29 16:00:27 -06:00
Joakim Erdfelt c89aca8fd3
Updating to version 12.0.7 2024-02-29 15:18:56 -06:00
Simone Bordet 9b64130ddc
Fixes #11432 - Review number of acceptor threads. (#11436)
Defaulted to 1.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-23 15:33:27 +01:00
Greg Wilkins 750584bc85
Experiment with ArrayByteBufferPool performance (#11426)
* Experiment with ArrayByteBufferPool

No overall size accounting
reserved buffer release always checks max memory
released buffers check max memory 1% of the time.
only a single thread can check memory at once.
single pass through buckets so no looping forever.

* Experiment with ArrayByteBufferPool

updates from review

* JMH updates

* updates from review

* Fixed comments.
Fixed call to recordEvict().
Removed unused methods.
Method getAvailable*Memory() no longer JMX-enabled, as they are the same as get*Memory().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-21 22:03:00 +01:00
Simone Bordet 8fec190b9c Fixes #9341 - jetty-jmh 10.013 fails due to "java.lang.AssertionError: No trie for TernaryTrie"
Fixed by using an enum and expression switch to avoid using string constants that may become obsolete.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-21 15:18:47 +01:00
Simone Bordet d02406c164
Fixes #11371 - Review ArrayByteBufferPool eviction. (#11400)
* Fixes #11371 - Review ArrayByteBufferPool eviction.

* Eviction is now performed on release(), rather than acquire().
* Memory accounting is done on release(), rather than acquire().
This is because we were always exceeding the memory usage on acquire(), by returning a non-pooled buffer.
We only need to account for what is idle in the pool, and that is done more efficiently on release(), and it is leak-resistant (i.e. if the buffer is not returned, the memory is already non accounted for, keeping the pool consistent).
* Released entries now give precedence to Concurrent.Entry, rather than Queued.Entry, so the queued pool is always kept at minimum size.
* Changed eviction algorithm to be simpler: one pass through the buckets excluding the current, trying to remove idle buffers until enough memory is recovered.
If successful, the buffer being released is pooled, otherwise it is also discarded.
* Added detailed statistics to ArrayByteBufferPool.RetainedBuckets.
* Added statisticsEnabled property in Jetty module bytebufferpool.mod.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-20 11:02:11 +01:00
Joakim Erdfelt 82d9177f0c
Updating to version 12.0.7-SNAPSHOT 2024-01-29 21:04:51 -06:00
Joakim Erdfelt 78ab6e6ba1
Updating to version 12.0.6 2024-01-29 20:42:49 -06:00
Joakim Erdfelt 96eea590ee
Updating to version 12.0.6-SNAPSHOT 2023-12-18 08:25:22 -06:00
Joakim Erdfelt 3aed62e495
Updating to version 12.0.5 2023-12-18 08:05:54 -06:00
Joakim Erdfelt 8597033339
Updating to version 12.0.5-SNAPSHOT 2023-11-30 13:33:03 -06:00
Joakim Erdfelt 9b415c6424
Updating to version 12.0.4 2023-11-30 13:14:15 -06:00
Greg Wilkins e800631120
Weak reference concurrent pool (#10787)
* The Pool is now a list of Holder instances, each with a WeakReference and a strong reference to an Entry.
* Removed thread-local cache from Pool.
* Avoid using deprecated ConcurrentPool constructors.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-09 22:32:50 +01:00
Joakim Erdfelt c01baac85c
Updating to version 12.0.4-SNAPSHOT 2023-10-26 22:47:29 -05:00
Joakim Erdfelt a873259fd5
Updating to version 12.0.3 2023-10-26 22:24:43 -05:00
Olivier Lamy fcc88274a4
Jetty 12.0.x use automatic formatter for poms to have same style for every poms (#10578)
* apply spotless sort pom

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-10-12 03:51:36 +02:00
Joakim Erdfelt 6b3f760b80
Updating to version 12.0.3-SNAPSHOT 2023-10-09 21:16:46 -05:00
Joakim Erdfelt b01e3611cf
Updating to version 12.0.2 2023-10-09 20:59:14 -05:00
Joakim Erdfelt 1d226403da
Updating to version 12.0.2-SNAPSHOT 2023-08-29 16:55:36 -05:00
Joakim Erdfelt 4768745849
Updating to version 12.0.1 2023-08-29 16:38:20 -05:00
Simone Bordet 4c32dfc4d8
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-24 18:56:21 +02:00
Simone Bordet b6a298f089
Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-24 18:47:30 +02:00
Lachlan c55363d43f
cleanups of DateCache (#10176)
* improve the formatting for precise ms in DateCache
* return original format string with DateCache.getFormatString
* calculate index in tick constructor because format strings can be different size
* use two ticks so that switching between seconds is less likely going to have cache miss
* use boolean instead of index to denote if sub second is needed
* remove formatWithoutCache and replace with doFormat as it doesn't work with sub second time
* allow the option of not having sub second precision
* use two separate formatters for the prefix/suffix around the SSS format code
* use a simple class to store both ticks in DateCache
* rename DateCache.Tick.getString(long) to format()

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-24 18:43:46 +02:00
Joakim Erdfelt 9c324326c5
Merge `release/12.0.0` back into `jetty-12.0.x` (#10237)
* Updating to version 12.0.0

* Updating to version 12.0.1-SNAPSHOT
2023-08-08 00:55:19 +02:00
Jan Bartel d3d298c5f3 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-06-29 15:01:19 +02:00
Jan Bartel 0a4232e261 Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x 2023-06-29 14:45:46 +02:00
Jan Bartel c8100b18b8
Update to bundle-plugin-5.1.9 (#9954) 2023-06-29 14:41:04 +02:00
Steffen Nießing 939689b669
Spotbugs fixes (#9961)
* Add zone id to DateTimeFormatter

Inline the call to withZone(ZoneId) because it returns a new DateTimeFormatter instead of modifying the current one in-place

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Remove redundant null-check

The array already was null-checked, so remove the redundant check

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Cleanup ArrayUtil

ArrayUtil provides static methods only -> Prevent instantiation and remove unused interfaces

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Remove dead assignment

The charset variable isn't accessed after the assignment anymore

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Prevent instantiation

TypeUtil contains static members only and should not be instantiated

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Remove redundant null-check

The loader variable is checked to be non-null before

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Restrict charset to ascii

The JavaDoc describes the byte array to contain ascii characters only

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Prevent instantiation

StringUtil contains static members only

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Prevent instantiation

IO contains static members only

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

---------

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
2023-06-26 18:24:13 +02:00
Joakim Erdfelt 1efe9afdf8
Updating to version 11.0.16-SNAPSHOT 2023-04-11 13:53:30 -05:00
Joakim Erdfelt 5bc5e562c8
Updating to version 11.0.15 2023-04-11 13:37:23 -05:00
Joakim Erdfelt ca3c1756ad
Updating to version 10.0.16-SNAPSHOT 2023-04-11 13:23:25 -05:00
Joakim Erdfelt 68017dbd00
Updating to version 10.0.15 2023-04-11 12:24:32 -05:00
Simone Bordet 99dc9c39f5
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-31 15:46:01 +02:00
Simone Bordet 814782cb2f
Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-31 15:39:42 +02:00
Simone Bordet 278ec1be69
Fixes #9237 - Decouple QTP idleTimeout from pool shrink rate. (#9498)
Introduced `QueuedThreadPool.maxEvictCount` to be the number of idle threads that are evicted in one idle timeout.

When set to 1 (the default), the old behavior is reproduced: expiring 1 thread every idle timeout.
When set to larger values, allows to keep around the threads for the idle timeout (in case of further load spikes), but allows to quickly recover OS memory when they are truly idle.

For example, with 2000 threads, 30 seconds idle timeout and idleTimeoutMaxShrinkCount=1, it will take 995 minutes (about 16.5 hrs) to shrink the pool back to 10 threads.
By setting idleTimeoutMaxShrinkCount=100, the thread pool can be shrunk to 10 threads in about 10 minutes.

Note also that the new algorithm is more aggressive at shrinking the thread pool.
Previously, a small load might have been sufficient to never evict any thread, because all threads could take turns at executing jobs so that threads were mostly idle but would never really idle time out.
The new algorithm is more aggressive even in presence of a small load, so that if `minThreads` are sufficient to cope with the small load, then the other threads are evicted.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: gregw <gregw@webtide.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: gregw <gregw@webtide.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-03-31 15:36:34 +02:00