Commit Graph

720 Commits

Author SHA1 Message Date
Olivier Lamy a600506155
fix merge
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-02-05 16:08:11 +10:00
dependabot[bot] 44cd3ee541
Bump maven.surefire.plugin.version from 3.0.0-M5 to 3.0.0-M8 (#9255) 2023-02-05 15:58:03 +10:00
Simone Bordet 9916706b5f
Issue #9293 - Jetty 12 - Relax JPMS dependencies (quic) (#9307)
Relaxed jetty-quic JPMS dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-04 14:38:33 +01:00
Simone Bordet c18194b20f
Issue #9293 - Jetty 12 - Relax JPMS dependencies (fcgi) (#9306)
Relaxed jetty-fcgi JPMS dependencies.
Packages generator and parser were not internal,
was just matters of exporting them.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-04 14:38:08 +01:00
Simone Bordet 55a27fc68c
Issue #9293 - Jetty 12 - Relax JPMS dependencies. (#9296)
Relaxed jetty-http2 and submodules JPMS dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-03 10:19:41 +01:00
Simone Bordet ec41480aed
Issue #9293 - Jetty 12 - Relax JPMS dependencies. (#9299)
* Issue #9293 - Jetty 12 - Relax JPMS dependencies.

Relaxed jetty-http3 and submodules JPMS dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-03 10:16:29 +01:00
Olivier Lamy 109dd70d67
fix dependency
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-02-03 19:07:26 +10:00
Simone Bordet 36b41af560
Merge pull request #9294 from eclipse/fix/jetty-12-client-jpms
Issue #9293 - Jetty 12 - Relax JPMS dependencies.
2023-02-03 09:55:35 +01:00
Olivier Lamy 0d485fbe28
this dependency is used in test scope
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-02-03 18:45:29 +10:00
Lachlan 1144d3a18f
Merge pull request #9234 from eclipse/jetty-12.0.x-websocket-core-server-jpms
Issue #9233 - Fix some JPMS issues for websocket-core
2023-02-03 14:05:34 +11:00
Olivier Lamy b93a115ecd
Jetty 12 - Rename sessions tests with ee# version in package name (#9231)
* rename sessions tests with eeX version in package name as it, we can indentify which test is failing with junit result
* get rid of some duplicate classes

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-02-03 10:49:44 +10:00
Simone Bordet cd5031b15f
Issue #9293 - Jetty 12 - Relax JPMS dependencies.
Relaxed jetty-client JPMS dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-02 19:30:40 +01:00
Greg Wilkins ebc6cca478
Jetty 12 - Added a core Session abstraction (#9223)
* Added a core Session abstraction

Sessions were already a core mechanism, but there was no API for them.
There is now a new Session interface that is available via the Request API.  It is intended only for users of sessions.
The previous concrete class Session has been renamed to ManagedSession and it is used by classes that extend AbstractSessionManager.

* Fixed tests

* Use static method

* Updates from review

* Updates from review

Improved javadoc
used util Attributes interface.
2023-02-02 21:40:17 +11:00
Ludovic Orban b1739aca53 Catch unchecked exceptions / errors thrown during produce to avoid letting the stack trace be logged by the execution strategy
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-02-02 10:42:20 +01:00
Joakim Erdfelt 490f86e9a6
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-02-01 19:33:43 -06:00
Ludovic Orban e68c827c2d
Fix connection pool's forcible stop (#9280)
* #9275 fix forcible closure of connections upon stopping the connection pool


Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-02-02 08:36:00 +11:00
Ludovic Orban 9295f93bd8 #9240 add null checks to methods that can be used on a stopped pool
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-02-01 18:43:02 +01:00
Greg Wilkins f4d5741b02 suppress stack
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2023-02-01 16:07:51 +11:00
Ludovic Orban a22270b4a5
Jetty 12.0.x silence tests' stacktraces (#9225)
* silence stack traces in IdleTimeoutTest by refactoring test + avoid execution of handlers over closed streams

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-02-01 14:43:50 +11:00
Lachlan Roberts 96fc36ca64 fix some jpms issues for websocket-core
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-31 20:09:51 +11:00
Greg Wilkins 50a88187fa
Jetty 12 - New HTTP Cookie interface (#9205)
Convert HttpCookie to an interface.
2023-01-31 10:02:28 +11:00
Greg Wilkins c871fa4402
Converted PathMappings to be an AbstractMap (#9213)
This was primarily done to avoid surprise of the previous behaviour of puts for a duplicate key being ignored.
The use of the AbstractMap class now provides javadoc and known/expected behaviour for key methods.
The only significant behaviour change is in the return type of some key methods, with the old/previous value replacing a boolean.
Some stream usage has also been replaced by the more efficient iterator.
2023-01-31 09:19:01 +11:00
Simone Bordet ae43c1f830
Fixed DetectorConnection buffer lifecycle. (#9227)
* Fixed DetectorConnection buffer lifecycle.

Now `detectAndUpgrade()` does not do any buffer lifecycle.
The buffer lifecycle is handled by the callers of `detectAndUpgrade()`.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-30 16:57:40 +01:00
Simone Bordet af6ecfebfe
Fixes #9210 - Jetty 12 - Review Pool and Pool.Entry (#9211)
* Fixes #9210 - Jetty 12 - Review Pool and Pool.Entry

* Extracted interface Pool, renamed implementation to ConcurrentPool.
* Extracted Pool.Entry as interface.
* Moved StrategyType to ConcurrentPool.
* Made Pool.Factory.wrap() work in order to wrap Pool instances.
* Removed constructors that were explicitly taking Pool parameters, replaced by a single Pool.Factory parameter.
* Added javadocs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-30 10:11:29 +01:00
Simone Bordet cd732a175c
Review and normalized all Maven module <name> for consistency.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-27 19:09:30 +01:00
Ludovic Orban 2424c86b34 #9145 fix websocket modules
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-01-27 17:44:09 +01:00
Simone Bordet ded18f523d
Fixes #9166 - Jetty 12: review/remove ByteBufferPool (#9195)
* Fixes #9166 - Jetty 12: review/remove ByteBufferPool

* Replaced usages of ByteBufferPool with RetainableByteBufferPool.
* Removed ByteBufferPool and related classes.
* Renamed oej.http2.frames.DataFrame.getData() -> getByteBuffer() for consistency.
* Removed Accumulator.acquire(), and updated code to use RetainableByteBufferPool.acquire() instead.
* Fixed HttpOutput callbacks to correctly call super.onCompleteSuccess() and super.onCompleteFailure().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-27 13:40:49 +01:00
Joakim Erdfelt 7f0294d4e5
Jetty 12 - Move test JPMS out of main `module-info.java` (#9203)
* Move test jpms out of main module-info.java
* There's no jetty-core/jetty-security anymore
2023-01-26 09:26:27 -06:00
Joakim Erdfelt 177fc234ef
Removing `@Disabled` on `SecuredRedirectHandlerTest` (#9208)
* Removing @Disabled on `SecuredRedirectHandler`
* Fixing javadoc
2023-01-26 09:26:09 -06:00
Joakim Erdfelt 08b9d6b8d9
Jetty 12 - Fixing simple `@named` virtualhost configuration (#9207)
* Fixing simple `@named` virtualhost configuration
* Fixing javadoc comment
2023-01-25 16:11:45 -06:00
Joakim Erdfelt c3ed8134dd
Adding javadoc 2023-01-25 16:06:35 -06:00
Joakim Erdfelt 81f7031cfe
Jetty 12 - Cleanup Shutdown classes (#9201)
* Fixed ShutdownHandler in jetty-core
* Delete ee9 ShutdownHandler
* Rename GracefulShutdownHandler to just GracefulHandler
* Adding graceful Jetty module
* Improved Javadoc + Token encoding tests
2023-01-25 13:54:53 -06:00
Joakim Erdfelt 7d8dd946cc
Add and allow plural form of existing args. (#9202)
+ new `--modules=<name>,<name>`
+ new `--libs=<classpath>`
+ updated usage.txt
+ updated warning output hint
2023-01-24 16:02:26 -06:00
Greg Wilkins 39e5667f1d
Jetty-12 Remove usage of HandlerList and reduce usage of Handler.Collection (#9191)
* Remove usage of HandlerList and reduce usage of Handler.Collection

"The best part is no part" - Elon Musk!

The overwhelming usage of `HandlerList` and `Handler.Collection` was for adding the `DefaultHandler` after the main handler.  This PR adds a getter/setter for a `DefaultHandler` on the server, so we no longer need to always create a `Handler.Collection` structure.   This has allowed the deprecated `HandlerList` and `HandlerWrapper` classes to be removed.

In implementing this PR, several problems were found in the calculation of `InvocationType`, not least that it was assumed that an empty `Handler.Collection` was `BLOCKING`.  When this issue was fixed, any dynamic addition of contexts (deployer or SPI server) failed as the `InvocationType` changed.  So this PR also introduces the `isDynamic()` attribute of all `Handler.Container`s.  A dynamic container will always return `BLOCKING` from `getInvocationType()`, as there is always a race with a new handler being added.   A non-dynamic container will return a real `InvocationType`, calculated from its children, but it's mutator methods will ISE if contained handlers are changed.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-25 08:08:09 +11:00
Joakim Erdfelt 53fc33161d
Remove junit internals usage. 2023-01-24 13:46:48 -06:00
Simone Bordet 8076aa10e7
Fixes implicit narrowing conversion reported in #9166.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-23 19:51:53 +01:00
Joakim Erdfelt 26a4ee5454
Jetty 12 - Introduce `GracefulShutdownHandler` and Test (#9174)
* Introduce GracefulShutdownHandler and test

+ started with removing `@Disabled` from `GracefulStopTest.java`
+ GracefulShutdownHandler based on Callback manipulation
2023-01-23 09:17:27 -06:00
Joakim Erdfelt 7920102702
Issue #9173 - Make wrapping of `ServletApiResponse` easier (#9175)
* Issue #9173 - Make wrapping of ServletApiResponse easier

* Fixing checkstyle and missing licenses
* Improved HttpCookie with javadoc and attribute handling
2023-01-23 08:23:30 -06:00
Greg Wilkins 99fdd219b7
Jetty 12.0.x 9131 remove path watcher (#9158)
* Reverted to Scanner for PropertyUserStore
* Remove PathWatcher from unassembled fork mode.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
2023-01-20 08:03:27 +11:00
Greg Poulos 06efbcaa7c
Jetty 12.0.x document modules (#9151)
* Add documentation in "Standard Modules" section for the jmx module
* Add documentation in "Standard Modules" section for the ee8,9,10-webapp modules
* Use shorter markup tags to transclude documentation from .mod files
* Extract EE version strings into variables
* Replace literal usages of EE version numbers with custom attribute
* Use convention 'eeN' instead of 'eex' in filenames
* Update metadata tag for deploy module documentation
* Update deploy module documentation to discuss EE platform-specific deploy modules
* Add documentation for the resources module
* Add resources module into section table of contents
* Use jetty-home instead of JETTY_HOME as documentation attribute

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-19 19:02:42 +01:00
Joakim Erdfelt fc762aea7d
Remove `@Disabled` from more `jetty-core/jetty-server` tests (#9162)
* Remove @Disabled from ConnectorTimeoutTests
* Remove @Disabled from SlowClientsTest
* Remove @Disabled from SslConnectionFactoryTest
* Remove @Disabled from DetectorConnectionTest
* Disabling quiche from checkstyle
* Removing ConnectorTimeoutTest BlockingTimeout tests
  + The concept of HttpConfiguration.blockingTimeout
     has been removed, these tests are no longer relevant
2023-01-19 10:31:51 -06:00
Joakim Erdfelt a37b8523e5
Jetty 12 - Javadoc cleanup & new inspection profile (#9165)
* Adding intellij-javadoc-inspection.xml for Jetty specific Javadoc inspection profile.
* Javadoc cleanup
2023-01-19 10:31:27 -06:00
Simone Bordet 0a002d7785
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-19 15:23:13 +01:00
Ludovic Orban f3c229437a
Add latency recording utility handler (#9172)
* #8069 add latency recording handler

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-01-19 10:27:05 +01:00
Joakim Erdfelt a06d1a29bb
Jetty 12 - Fix for HttpParser quick HTTP Version lookahead (#9171)
+ Removed the array optimized look ahead
+ version lookahead now done with getInt
+ improved test harness to check lf and crlf endings
+ added HTTP as int optimization
+ fixed bug in near miss of field cache

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
2023-01-18 09:37:55 +11:00
Joakim Erdfelt 6d1e244af6
Merge pull request #9136 from kohlschuetter/jetty-12-NativeImageResourcePath2
* util: Add support for GraalVM Native-Image resource:-URIs and Paths

GraalVM Native-Image makes its classpath resources accessible through an
opaque resource: URL scheme.

Add support for this scheme in URIUtil and PathResource.

Automatically create the NativeImageResourceFileSystem when necessary.
Also add a workaround where converting such Native-Image Paths back to
URI would yield the wrong URI (potentially a bug in GraalVM).

https://github.com/eclipse/jetty.project/issues/9116
https://github.com/oracle/graal/issues/5720

* URIUtil: Suppress CodeQL false positive error about path injection

Github CodeQL code scanning reports a high-severity error "Uncontrolled
data used in path expression", because a path depends on a user-provided
value.

This is a false positive.

Suppress the error by annotating a corresponding @SuppressWarnings tag.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* URIUtil: Removed unused code

KNOWN_SCHEMES isn't used anywhere.

* PathResource: Selectively enable resource: for GraalVM Native Image

In regular HotSpot VMs, the resource: scheme may be registered by other
clients. However, in GraalVM Native Image, this is used for classpath
resources.

This resource scheme needs to be enabled by default for Native Image
environments so we can support code that is unaware of GraalVM
internals, such as:

URL resourceURL = MyClass.class.getResource("some/resource");
Resource resource = ResourceFactory.root().newResource(resourceURL);

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* PathResourceFactory: Ignore certain RuntimeExceptions upon init

Ignore FileSystemAlreadyExistsException, ProviderNotFoundException, etc.
that may be thrown upon calling FileSystems.newFileSystem.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* PathResource: Work-around false positive CodeQL warning

CodeQL prevents amending the call to Paths.get.

Work-around this by using a separate constructor. The additional benefit
is that URIUtil.correctResourceURI won't need to correct the URI twice.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* PathResource: Fix "isAlias" issue with resource: URIs

Fix two more places where Native Image resource: URIs need to be
changed.

Without this change, Resource#isAlias() would return true for such URIs,
and a warning like "BaseResource resource:/some/package/ is aliased to
resource:file:///resources!/some/package/" would be logged.

* Move GraalVM Native-Image code to NativeImagePathResource/-Factory

Keep the GraalVM Native-Image code contained in custom subclasses.

We still enable the "resource:" URL scheme by default if a GraalVM
Native-Image environment is detected via System property. This allows us
to transparently support calls like
ResourceFactory.root().newResource(MyClass.class.getResorce("webapp"))

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* Refactor Graal native-image resource: handling

Detect the resource: scheme by checking the scheme of a well-known
resource instead of looking at a system property.

Rename NativeImagePathResource* to GraalIssue5720PathResource* and make
these classes package-private.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* Only use GraalIssue5720PathResourceFactory when truly needed

Previously, we were always enabling this resource factory for GraalVM
native-image environments.

We now check if that's actually necessary.

We fall back to MountedPathResourceFactory or PathResourceFactory,
depending on whether the URL contains "!/" or not.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>
2023-01-17 13:08:50 -06:00
Greg Wilkins a4ee42944b suppress test stacks 2023-01-17 16:58:55 +11:00
Greg Wilkins 94991c60c0
Jetty 12 temp directory cleanup (#9153)
+ `Server` now has setter/getter for a temp directory, which can be null
 + `Context` now has a getter for a temp directory, which is never null 
 + Server root Context temp directory is either whatever is set, else a work directory, else java.io.tmpdir
 + WebInfConfiguration will still create a temp directory name, but defers to ContextHandler for creation/persistence of the temp directory
 + temp directory (and BASE) removed from the deployer, as it is now the server temp directory.
2023-01-17 11:44:09 +11:00
Christian Kohlschütter cdea111d3f Only use GraalIssue5720PathResourceFactory when truly needed
Previously, we were always enabling this resource factory for GraalVM
native-image environments.

We now check if that's actually necessary.

We fall back to MountedPathResourceFactory or PathResourceFactory,
depending on whether the URL contains "!/" or not.
2023-01-16 23:27:53 +01:00
Christian Kohlschütter 30ffbcb7e4 Merge remote-tracking branch 'upstream/jetty-12.0.x' into jetty-12-NativeImageResourcePath2 2023-01-16 18:48:04 +01:00