Commit Graph

1629 Commits

Author SHA1 Message Date
Simone Bordet bb27fa6cc0 Issue #3747 - Make Jetty Demo work with JPMS.
Added distribution test for running with JPMS.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-17 11:18:14 +02:00
Simone Bordet 422b9bded5 Fixes #3747 - Make Jetty Demo work with JPMS.
Introduced module `jdbc` and made other modules that require JDBC depend on it.
Modified demo.ini to enable the `jdbc` module because some webapp descriptor
of the demo requires JDBC classes.

Now the demo can be run fine on the module-path just by adding --jpms.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-16 22:57:55 +02:00
Joakim Erdfelt 43e10f8a5e
Merge pull request #4056 from eclipse/jetty-9.4.x-testing-embedded-examples
Unit Testing the Embedded Examples
2019-09-11 09:20:10 -05:00
Jan Bartel a563cdca76
Issue #4025 Add flushOnResponseCommit mode to sessions. (#4049)
* Issue #4025 Add flushOnCommit mode to sessions.

Added flushOnCommit mode to write a session to the backing store as the
response commits, before any bytes are returned to the client.

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-09-11 09:10:35 +10:00
Joakim Erdfelt f6aea22979 Issue #3989 - Cleaning up FailedSelectorTest
+ Based on PR review
+ Squelching logging output
+ Removing stacks from ManagedSelector logging

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-09 20:35:02 -05:00
Joakim Erdfelt 13413c8027 More testing of embedded examples
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-09 17:58:06 -05:00
Joakim Erdfelt b7b744160f Issue #3989 - Tests for both Restart Server and Selector
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-06 16:10:30 -05:00
Joakim Erdfelt f8041b23bd Issue #3989 - Cleaning up ManagedSelector.doStop() for dead selector
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-06 14:54:01 -05:00
Joakim Erdfelt 0596d6c352 Merge branch 'jetty-9.4.x' into jetty-9.4.x-3989-selector-failure 2019-09-06 14:35:17 -05:00
Joakim Erdfelt 3171ad5fe6 Issue #3989 - Updating testcase to restart server on select failure
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-05 20:23:59 -05:00
Joakim Erdfelt 20f7a473ee Fixing License header date range 2019-09-04 16:32:52 -05:00
Joakim Erdfelt 9305914d6a Issue #3989 - Selector failure notification
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-04 11:16:24 -05:00
康智冬 49ba6d1acb fix typo and grammar (#4045)
Signed-off-by: KangZhiDong <worldkzd@gmail.com>
2019-09-02 14:29:50 -04:00
Joakim Erdfelt f6efff70d7 Issue #3989 - Selector failure notification
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-30 13:47:16 -05:00
Jan Bartel f4d95e0f2f Remove blank lines for NullSessionCacheTest
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-28 11:22:14 +10:00
Jan Bartel a2fc9b113b Fix and enhance session invalidation tests.
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-28 11:04:31 +10:00
Greg Wilkins 83463c2a23
Issue #3964 - Listener behavior cleanup (Jetty 9.4.x) (#3965)
Issue #3964
* Avoid creating listener list for rarely used requestAttributeListener
* AbstractConnector keeps a specific list of HttpChannel.Listeners
to avoid Connection.Listeners and MBean listeners being added to
the HttpChannel listener list.
* Simplified listener handling by avoiding null connector, previously
only needed for testing.
* Fixed test that assumed HttpChannel listeners were not cleared by a recycle
* Separated out durable vs cyclic HttpChannel.Listeners, so as to
simplify handling.
* Deprecated cyclic HttpChannel.Listeners, as I'm not sure the channel is
the right place for them.
* Added improved method to combine multiple HttpChannel Listeners
into a single Listener.
* Fixed MockConnector
* Added benchmark
* Improved benchmark
* Updates from review
* Removed benchmark and alternate implementations.
* Updated javadoc
* Updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 17:38:20 +10:00
Jan Bartel 387e33acaf
Issue #4006 Fix ClusteredSessionMigrationTest (#4010)
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-27 10:53:54 +10:00
Greg Wilkins bde86467f4
Issue #3806 - Make Async sendError fully Async (#3912)
* Issue #3806 async sendError

Avoid using isHandled as a test withing sendError as this can be
called asynchronously and is in a race with the normal dispatch of the
request, which could also be setting handled status.

The ErrorHandler was dispatching directly to a context from within
sendError.  This meant that an async thread can call sendError and be
dispatched to within the servlet container at the same time that the
original thread was still dispatched to the container.

This commit fixes that problem by using an async dispatch for error
pages within the ErrorHandler.  However, this introduces a new problem
that a well behaved async app will call complete after calling
sendError.  Thus we have ignore complete ISEs for the remainder of
the current async cycle.

Fixed the closing of the output after calling sendError. Do not
close if the request was async (and thus might be dispatched to an
async error) or if it is now async because the error page itself is
async.

* updates from review
* better tests
* revert ignore complete
* added some TODOs
* more TODOs
* fixed rename
* cleanup ISE and more TODOs
* refactored to call sendError for uncaught exceptions rather than onError
* more of the refactor
* extra tests for sendError from completing state

Reworked HttpChannelState and sendError so that sendError is now
just a change of state. All the work is done in the ErrorDispatch
action, including calling the ErrorHandler.  Async not yet working.

Additional tests

Converted ERRORED state to a separate boolean so it can be used for
both Sync and Async dispatches.

Removed ASYNC_IO state as it was just the same as DISPATCHED

The async onError listener handling is now most likely broken.


WIP making sendError simpler and more tests pass
WIP handling async and thrown exceptions
WIP passing tests

Improved thread handling

removed bad test

Implemented error dispatch on complete properly
more fixed tests

sendError state looks committed

- Added resetContent method to leave more non-content headers during sendError
- Fixed security tests
- simplified the non dispatch error page writing.  Moved towards being able to write async

* fixed gzipHandlerTest

* Updated handling of timeout errors.  According to servlet spec,
exceptions thrown from onTimeout should not be passed to onError, but
just logged and ignored:

   If an exception is thrown while invoking methods in an AsyncListener,
   it is logged and will not affect the invocation of any other AsyncListeners.

* This changes several tests.

* Dispatcher/ContextHandler changes for new ERROR dispatch handling. Feels a bit fragile!

* Fixed tests in jetty-servlets
* Fixed tests in jetty-proxy

* more test fixes

* Fixed head handling
reverted unnecessary changes
Improved reason handling

WIP on fully async error handling.
Simplified HttpChannelState state machines to allow for async actions
during completing

more WIP on fully async error handling.

sendError and completion are not both non-blocking, without using
a startAsync operation. However we are lacking unit tests that actually
exercise those code paths.

* Simplified name of states
Added test for async completion
* Cleanups and javadoc
* Cleanups and javadoc
* remove snake case
* feedback from review
* Write error page into fixed pooled buffer

Use the response to get/release a pooled buffer into which the error
page can be written.  Make it a fixed sized buffer and if it overflows
then no error page is generated (first overflow turns off showstacks
to save space).

The ErrorHandler badly needs to be refactored, but we cannot change
API in jetty-9

* More test fixes for different error page format
* minor cleanups
* Cleanup from Review
* Fixed javadoc
* cleanups and simplifications
* Cleanup from Review
* renaming and some TODOs
* Cleanup from Review
* Checkstyle fixes
* Cleanup from Review
* Code cleanups and simplifications
* fixed debug
* Cleanup from Review
* Ensure response sent before server shutdown
* removed unnecessary optimisation
* fixed duplicate from merge
* Updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-26 17:55:58 +10:00
Jan Bartel 0f8230c05b
Issue #3936 Provide write-through modes for the NullSessionCache (#3984)
* Issue #3936 Provide write-through modes for the NullSessionCache

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-26 15:22:20 +10:00
Olivier Lamy fe3d3f7158
fix checkstyle in test sources (#4013)
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-22 19:56:41 +10:00
Joakim Erdfelt 50b524bb6b Merge branch `release-9.4.20` into `jetty-9.4.x` 2019-08-15 07:27:25 -05:00
Jan Bartel af6c675023
Issue #3913 Fix races in session request reference counting (#3947)
* Issue #3913 Fix races in session request reference counting

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-08-15 12:27:18 +10:00
Joakim Erdfelt f1efc99918 Updating to version 9.4.21-SNAPSHOT 2019-08-13 17:34:20 -05:00
Joakim Erdfelt 84700530e6 Updating to version 9.4.20.v20190813 2019-08-13 16:13:21 -05:00
Greg Wilkins 8c4dd7ab05 Fixed decoration changes for #3804
Fixed bad names in OWB webapp.
Don't have the owb jetty-web.xml on by default.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-13 11:14:44 +10:00
Joakim Erdfelt e7a1978556
Merge pull request #3946 from eclipse/jetty-9.4.x-3804-Decoration-rename
Issue #3804 CDI integration rename
2019-08-09 08:43:07 -05:00
Greg Wilkins bf1ece938f Issue #3804
more review changes

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-09 08:20:27 +10:00
Joakim Erdfelt bcb4c59ab2 Issue #3804 - cleanup of CDITest arguments
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-08 10:21:12 -05:00
Lachlan 3f34301660
do not echo part content in MultiPartTest (#3942)
* sanitize xml from multipart upload in MultiPartTest

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* changes from review

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* no longer echoing back part content

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-08-08 17:55:31 +10:00
Greg Wilkins 516fdd45cb Issue #3804
improved javadoc

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-08 16:11:02 +10:00
Greg Wilkins 70fcd3d145 Issue #3804 CDI integration
Rename attributes and classes to have a more regular pattern.
The DecoratingListener is now extened by the
CdiDecoratingListener which is used by the cdi-decorate module

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-08 12:24:41 +10:00
Greg Wilkins dc939d753a
Issue #3804 - Update Decorator integration for various CDI implementations (#3838)
* Jetty Issue #3804 WELD-2587

Support CDI integration:
 + cdi2 module exposes jetty APIs
 + cdi module uses DecorationListener

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Jetty Issue #3804 WELD-2587

Remove DecoratingListener tests from test-jetty-webapp

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* improve CDI test

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Jetty Issue #3804 WELD-2587

Reverted test to use released CDI and cdi2 module for now.
To test new mechanism, you need to build the weld snapshot locally,
rebuild and switch to cdi module

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* remove cdi2 webapp references

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* document attribute

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* improved documentation

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* logging

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* improved javadoc

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Fixed version

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Reverted to also provide the DecoratingListener in the decorate module.
Renamed cdi-demo to weld-cdi-demo

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* revert from Weld SNAPSHOT

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* test all 3 weld integrations

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* updated destory implementation to release creationalcontext

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* reverted to released Weld version

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3804 CDI integration

dispose and release context in destroy

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Improved CDI module documentation

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* WIP on OWB

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Updates from review
Parameterised CDITests

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* share webapp resources for cdi webapp test

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* Initialize OWB with a SCI so that listeners can be decorated

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Added OwbDecorator so that cdi2 module can be tested with OWB

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Lookup attribute name

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Cleanups

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Cleanup from Review

Don't do lazy bindings

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Cleanup from Review

Treat partial CDI same as no CDI

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* fix maven it test no more need of weld-servlet

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* cleanup it parent pom removing non needed weld servlet

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* upgraded to Weld 3.1.2.Final

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Cleanup from Review

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Cleanup from Review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-08 04:04:07 +02:00
Simone Bordet 762767c62c Fixes #3601 - HTTP2 stall on reset streams.
After review, updated the logic to always fail the transport.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-01 15:52:47 +02:00
Olivier Lamy b7fdf9f9f3
upgrade to junit 5.5.1 (#3925)
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-01 17:46:06 +10:00
Olivier Lamy 3c14ceab27
avoid transitive depdency on a range version which can failed the build... (#3862)
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-07-10 20:19:06 +10:00
Simone Bordet 48209e340e Increase wait time to ensure that the session scavenging happens.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-07-04 21:35:06 +02:00
Jan Bartel bb7fb48f08
Fix checkstyle warnings for tests. (#3846)
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-07-03 16:42:20 +02:00
Greg Wilkins 89e756a21e Fix checkstyle warnings
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-07-02 13:20:48 +02:00
Jan Bartel e26179e8e9
Issue #3799 Programmatic listeners from ServletContextListeners. (#3824)
* Issue #3799 Programmatic listeners from ServletContextListeners.

Ensure programmatic listeners added from ServletContextListeners are
called.

Signed-off-by: Jan Bartel <janb@webtide.com>

* Issue #3799 add distribution test

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-07-01 15:14:19 +02:00
Jan Bartel 4f74e19463
Issue #3749 Fix memory leak for AsyncContextListeners with annotations (#3769)
* Issue #3749 Fix memory leak for AsyncContextListeners with annotations

Also make InjectionCollection and LifeCycleCollection threadsafe for
readers with concurrent modifications.

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-07-01 14:46:40 +02:00
Greg Wilkins a42ad99871 Misc minor checkstyle fixes
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-25 11:13:34 +02:00
Greg Wilkins 9706d70484
Jetty 9.4.x reformat (#3811)
* Removing Legacy Method Separators
* Restyling branch `jetty-9.4.x`
* Applying changes highlighted by checkstyle
* Applying XML restyling
* Fixing XML codestyle for IntelliJ
* Fixing XML style mistakes
* Revert "Applying XML restyling"
* Updating checkstyle for XML codestyle
* Reformatting pom.xml files
* Fixed empty string from line wraps
* Update intellij style to not do expression relative formatting. Reformatted code based on that.
* Increasing line split on Eclipse IDE Formatter to 512
* Restoring setting on internal default value.
+ IntelliJ will not export settings on things that set to their
  internal default values.
  We want to keep those values as a hedge against future default
  value changes in future releases of IntelliJ.
* Fixing intellij codestyle
* do not allow single line simple methods
* misc checkstyle fixes
* re-exported with correct name and all values

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-24 17:40:30 +02:00
Joakim Erdfelt 6ca87a0de1 Merge branch `jetty-9.4.x` into `jetty-9.4.x-3700-felix-webapp-testing`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	tests/test-webapps/pom.xml
2019-06-21 14:44:56 -05:00
Joakim Erdfelt 075333a627 Merge `jetty-9.4.x` into `jetty-9.4.x-3700-felix-webapp-testing`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java
2019-06-20 15:37:48 -05:00
Joakim Erdfelt 2f4f42a7df Merge branch `jetty-9.4.x` into `jetty-9.4.x-3731-cdi-testing` 2019-06-18 11:30:47 -05:00
Joakim Erdfelt cc966dd1f2 Issue #3700 - Using newer felix version
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-18 10:13:56 -05:00
Joakim Erdfelt 40e9e053b9
Merge pull request #3768 from eclipse/jetty-9.4.x-3708-stringutil-replace
Issue #3708 - use StringUtil alternatives for known slow JVM impls.
2019-06-13 14:01:35 -05:00
Joakim Erdfelt db30cbd184 Issue #3700 - Adding felix webapp tests to discover OSGi issues earlier
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-12 14:37:13 -05:00
Joakim Erdfelt dc23b8da6a Issue #3731 - Bumping up version now that 9.4.19 is released
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-12 13:58:36 -05:00