Commit Graph

29572 Commits

Author SHA1 Message Date
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
Ludovic Orban 509ede1d85
Add jersey test module (#11423)
Add jersey test module

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-21 22:00:07 +01:00
Simone Bordet f3b37bc277 Fixes #8887 - Jetty-12 client calls onDataAvailable with producing thread.
Now the calls to the upper layer produce tasks that are fed to the ExecutionFactory in HTTP2Connection.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-21 21:47:45 +01:00
Joakim Erdfelt 2d51170be2
Fixes #11310 - multipart parser dropping some relevant CR bytes in parts (#11409)
Fixed case in MultiPart.Parser where a small chunk contains part of the boundary.

Added and fixed related tests.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-21 21:43:26 +01:00
Danish Nawab f8601750f3
Fixes #11353 named virtual thread executor (#11430)
Introduced `VirtualThreads.getNamedVirtualThreadsExecutor(String namePrefix)` to allow users/libraries to name virtual threads if they so wish.
2024-02-21 21:38:58 +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
Ludovic Orban 3a6ad49271
Jetty 12: `ContextHandler.getTempDirectory()` does not respect the `Context.getTempDirectory()` contract (#11397)
#11396 fix ContextHandler.getTempDirectory() so it never returns null as the contract mandates

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-02-21 09:26:34 +01:00
Joakim Erdfelt aa5eff978c
Issue #11410 - PathMappingsHandler does not set Server on added handlers (#11412)
* PathMappingsHandler does not set Server on added handlers
2024-02-20 14:08:44 -06:00
Greg Wilkins f07d812698
Fix #11414 URI schema and port normalization (#11416)
* Issue #11414 - use HttpURI instead of URIUtil to have a single point of spec behavior

* Issue #11414 - enforce lowercase scheme in HttpConfiguration.secureScheme

* Issue #11414 - Scheme produced on `Location` header is lowercase

* Issue #11414 - Scheme to lowercase

* Issue #11414 - Scheme to lowercase

* Revert change to HttpClient

* Added schema port knowledge to URIUtil

* Fixed tests for normalized URIs

* updates from review

* updates from review

* Fix tests

* Restored methods as deprecated

* More testing

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-02-20 20:12:55 +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
Simone Bordet 624ee584bd
Issue #6140 - SelectorManager total keys.
Removed toString() override that was not calling super, to restore printing the total number of keys in dumps.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-20 10:21:35 +01:00
Greg Wilkins 08174a3042
Fix #11401 StringBuilder rather than StringBuffer (#11406) 2024-02-19 14:52:17 +00:00
gregw 747da1bc74 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2024-02-19 15:06:41 +01:00
gregw d43c20eb54 Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x
Signed-off-by: gregw <gregw@webtide.com>
2024-02-19 15:05:40 +01:00
gregw 82967d678e updated 9.4 in VERSION.txt
Signed-off-by: gregw <gregw@webtide.com>
2024-02-19 14:44:23 +01:00
Greg Wilkins b89c7ebefe
Do not throw from HttpChannelState.read() method (#11369)
Fixes #11363 by ensuring that read never throws, but instead returns an Error chunk.
2024-02-19 08:28:16 +00:00
Lachlan Roberts 0ece73b769 PR #11402 - add check for null networkBuffer in WebSocketConnection
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-16 16:19:31 +11:00
Lachlan Roberts 6b079acf78 PR #11279 - move isSameFile method to Resource
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-16 10:47:51 +11:00
Lachlan Roberts 87aeefbbc9 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-11271-AliasCheckCombinedResource 2024-02-15 23:48:40 +11:00
Lachlan Roberts 783c14cec4 Issue #11398 - do not deliver messages until onOpen completes
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-15 13:07:28 +11:00
Hervé Boutemy 3d3682597f
drop buildnumber:create already executed by jetty-util (#11360)
* drop buildnumber creation already done by jetty-util
* copy build.properties from jetty-util
2024-02-15 02:52:01 +01:00
Joakim Erdfelt 645e775114
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2024-02-14 16:11:05 -06:00
Simone Bordet 0e79997965 Fixes #11403 - Expose SslEndPoint in SslHandshakeListener
Now also exposing the `EndPoint` in SslHandshakeListener.Event.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-14 13:41:48 +01:00
Lachlan 55e3072247
Merge pull request #11357 from jetty/jetty-12.0.x-ServerWebSocketContainer-ensure
Issue #11356 - Allow ServerWebSocketContainer to be created without ContextHandler
2024-02-14 20:18:20 +11:00
Lachlan Roberts 25fb7be7a9 Issue #11398 - allow frames to be demanded in WebSocket onOpen
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-14 15:20:34 +11:00
Simone Bordet a683690678
Added documentation about `SslHandshakeListener`. (#11383)
* Added documentation about `SslHandshakeListener`.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-10 17:06:40 +01:00
Simone Bordet 2a72ded229 Fixed ArrayByteBufferPoolTest, making it not sensible to random GC cycles that may modify the pool by removing buffers that were leaked in the tests.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-09 15:44:02 +01:00
Joakim Erdfelt b503e17c5e
Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x 2024-02-08 09:40:25 -06:00
Joakim Erdfelt a6b88c6ef2
Allow spec port stripping of 80/443 on websocket too.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-02-08 09:39:52 -06:00
Joakim Erdfelt e5d95b4668
Merge pull request #11386 from jetty/fix/12.0.x/formfields-default-from-context-not-request
Making FormFields get defaults from Context, not Request
2024-02-08 05:09:22 -06:00
Joakim Erdfelt 4511d5e4a5
Making FormFields get defaults from Context, not Request. 2024-02-07 11:59:38 -06:00
Joakim Erdfelt b5e40d7e5b
Fixing README.md links 2024-02-06 17:26:13 -06:00
Joakim Erdfelt 2de4545ccb
Fixing CONTRIBUTING.md links 2024-02-06 17:25:48 -06:00
Joakim Erdfelt fcaa004389
Fixing contribution-guide links 2024-02-06 10:34:06 -06:00
Joakim Erdfelt 4d1b05ff97
Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x 2024-02-06 10:24:26 -06:00
Joakim Erdfelt 721b1743cb
Correct contribution-guide documentation
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-02-06 10:24:01 -06:00
Simone Bordet 192294f9b9
Fixed javadocs links in documentation.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-06 15:33:42 +01:00
Simone Bordet 7e4621fea4 Fixes #11372 - Scheduler queue in the HTTP client grows infinitely when a server times out
Fixed regression introduced with #9897.
After onExpire() returns false, the entity is asked again the expirationNanoTime, but there was no check whether it was Long.MAX_VALUE, indicating that the entity should not be rescheduled.

This was causing scheduling of timeouts far in the future (about Long.MAX_VALUE nanos away), but each at a slightly different time, causing the leak.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-05 17:47:23 +01:00
Lachlan Roberts e3c9e2fd54 PR #11357 - fix checkstyle errors
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-02 13:41:56 +11:00
Lachlan Roberts bbdaf072db PR #11357 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-02 13:31:28 +11:00
Lachlan Roberts 077f9bcf61 PR #11357 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-02 13:20:52 +11:00
Joakim Erdfelt b9855fc57b
Merge pull request #11346 from jetty/dependabot/maven/jetty-11.0.x/dev-dependencies-5c86de19d6
[11.0.x] Bump the dev-dependencies group with 2 updates
2024-02-01 06:31:13 -06:00
dependabot[bot] 098f817c38
[11.0.x] Bump the dev-dependencies group with 2 updates
Bumps the dev-dependencies group with 2 updates: [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) and [org.eclipse.tycho:tycho-p2-repository-plugin](https://github.com/eclipse-tycho/tycho).


Updates `com.puppycrawl.tools:checkstyle` from 10.12.7 to 10.13.0
- [Release notes](https://github.com/checkstyle/checkstyle/releases)
- [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-10.12.7...checkstyle-10.13.0)

Updates `org.eclipse.tycho:tycho-p2-repository-plugin` from 4.0.4 to 4.0.5
- [Release notes](https://github.com/eclipse-tycho/tycho/releases)
- [Changelog](https://github.com/eclipse-tycho/tycho/blob/tycho-4.0.5/RELEASE_NOTES.md)
- [Commits](https://github.com/eclipse-tycho/tycho/compare/tycho-4.0.4...tycho-4.0.5)

---
updated-dependencies:
- dependency-name: com.puppycrawl.tools:checkstyle
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: org.eclipse.tycho:tycho-p2-repository-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 00:45:08 +00:00
Joakim Erdfelt 2584eb0429
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2024-01-31 09:17:47 -06:00
Joakim Erdfelt bdc84e2dc9
Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x 2024-01-31 09:16:36 -06:00
Lachlan Roberts 07d97de2cd PR #11279 - clarify javadoc in TrailingSlashAliasChecker
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-31 11:30:13 +11:00
Lachlan Roberts 03313567e8 PR #11279 - fixes for AliasCheckerMultipleResourceBasesTest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-31 01:13:08 +11:00
Lachlan Roberts ee1d24ffdb Issue #11356 - Allow ServerWebSocketContainer to be created without ContextHandler
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-30 20:39:13 +11:00
Lachlan Roberts 1398bf930e add example in javadoc for TrailingSlashAliasChecker
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-30 15:36:29 +11:00
Joakim Erdfelt 82d9177f0c
Updating to version 12.0.7-SNAPSHOT 2024-01-29 21:04:51 -06:00