Commit Graph

89 Commits

Author SHA1 Message Date
Greg Wilkins 14152c425b
Better handling of Objects in JMX MetaData (#10762)
* Send attributes as Map<String,String>
* JMX-annotated ErrorHandler, fixed usage of showMessageInTitle and removed showServlet.
* JMX-annotated Request.Handler.
* Added JMX test module to test improvements to JMX.

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-24 10:03:28 +11: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
Ludovic Orban 9275d2acca Made tests relying on TestForbiddenMethodsEventsHandler not flaky
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-10-10 17:09:56 +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
Ludovic Orban fb3c2a0ebe Disable more flaky tests failing because of buffer leaks
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-10-05 14:44:53 +02:00
Simone Bordet 53de4c8298
Fixes #10611 - Flaky StreamResetTest.testClientResetConsumesQueuedData() (#10655)
Fixed test case that was racy.
When the DATA frames arrived at the server before the call to consumeAvailable(), they were read and the client flow control window re-opened.
If it happened that the DATA frames arrived at the server after the call to consumeAvailable(), the client flow control window was not re-opened, making the test flaky.
Fixed by avoiding the race in the test.

Added over-release buffer tracking, add leak tracking to H2 tests, fix client leaks in tests.

Also reviewed the places that required re-opening of the flow control window in case the DATA frames are not read.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-10-04 14:47:26 +02:00
Lachlan aa880cff09
Issue #10513 - fix multipart lockup with HTTP/2 (#10554)
* Changes the H2 semantic of `Stream.readData()` so that it is `readData()` that enlarges the flow control window, and not anymore the release of the `Stream.Data`.
This allows applications to buffer in memory by retaining the `Stream.Data` instances more than the H2 flow control window.
* Updated `FlowControlStrategyTest` after `Stream.readData()` semantic changes.
* Updated `DataDemandTest` after `Stream.readData()` semantic changes.
* Updated documentation.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: gregw <gregw@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-09-28 11:47:32 +02:00
Ludovic Orban 5ffbf523d7 #10543 use var instead of fully qualified class name
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban e290ff9561 #10543 re-instate H3 fix as temporary
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban b9f1fb3187 #10543 make sure drainClearBytesForStream() returns -1 instead of throwing when the stream is finished to avoid a stack overflow
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban 5c9d796a49 #10543 handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban b25dc8183b #10543 handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban 1286f91b1c #10543 record failure as chunk to avoid consumeAvailable to stack overflow
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban 45359a063f
disable leak tracking on tests that fail flakily because of leaks (#10566)
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-26 01:55:50 +02:00
Simone Bordet 8684b0a67a
Introduced CompletableResponseListener (#10502)
Introduced CompletableResponseListener, a replacement for FutureResponseListener that uses better APIs based on CompletableFuture.

Deprecated FutureResponseListener and replaced its usages.

Updated documentation.

Added tests for zipped request content.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-14 15:33:51 +02:00
Jan Bartel 4bbfa3949b
Issue #10440 fix ClassCastException for <jettyEnvXml> in maven plugin (#10493)
* Issue #10440 fix ClassCastException for <jettyEnvXml> in maven plugin

* disable H1 client leak tracking for testInputStreamContentProviderThrowingWhileReading

Signed-off-by: Ludovic Orban <lorban@bitronix.be>

---------

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-09-12 07:49:45 +02:00
Ludovic Orban 499816f79c #10226 fix HTTP consumeAvailable() buffer leak and re-enable tests
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-11 11:47:04 +02: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 c638753b8d Fixes #10293 - Improve documentation on how to write a response body in Jetty 12.
Updated documentation about:
* Content.Source
* Content.Sink
* Handler
* Request/Response

Updated few APIs to make easier to write applications.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-29 22:07:42 +02:00
Ludovic Orban 155137605a #10226 disable client leak tracking for H1 transports
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 8ae62e3a95 #10226 disable client leak tracking for all transports
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban f3a21cec6f #10226 fix heap dump
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 159238471b #10226 handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban a4e33a019f #10226 disable leak tracking only for client/server or impacted transports
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 18797fad57 #10226 add ability to disable leak tracking and disable currently known leaky threads
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 44aa6036b3 #10226 assert using awaitility and fix heap dump cleanup when a leak is detected
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 01f8812dbb #10226 improve testDownloadWithCloseMiddleOfContent debuggability by helping to discriminate the buffers by their content
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban eece4b0fde #10226 dump the heap when a buffer leak is detected
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 174c59e9a1 #10226 assert using awaitility
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 7083fa3927 #10226 restore leak tracking in tests
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Simone Bordet a12eccdd93
Larger timeout for testTrailers().
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-24 18:13:42 +02:00
Simone Bordet 50dfb003af
Smaller write for testTrailers() is enough.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-24 18:01:43 +02:00
Simone Bordet c977ea1de9
Make sure the tests specify a request total timeout to avoid infinite waits.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-24 17:50:56 +02:00
Simone Bordet 7f1d262aee
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-23 15:47:15 +02:00
Simone Bordet 24792db09c Fixes #10218 - NPE in HttpChannelOverFCGI.receive()
Simplified the code, removing all leftover cruft present since FCGI was multiplexed.
Now the FCGI implementation is very similar to HTTP1.

Made HttpConnectionOverFCGI.channel final so that it cannot NPE anymore.

The client now properly handling server-side connection closes.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-16 15:27:59 +02:00
Simone Bordet 6bd067cb5a
Suppressed exceptions during testing.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-08 11:44:22 +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
Greg Wilkins 70a7a6769c
Fix #10229 servlet Idle Timeout (#10233)
* Fix #10229  Idle Timeout

Added test to reproduce

Fixed NPE if no failure listener


Possible

Added test that idle works between requests

EE9 idle timeout

idle if read operation

Handle idleTimeout for IO operations differently

improve comments

fixed test to not expect timeout listener to be called if there is demand

Idle timeouts for IO operations are not last.

Disable transient idle timeouts since AsyncContentProducer cannot handle them.

revert test to persistent idle failures
2023-08-07 06:05:05 +10:00
Simone Bordet 5a3549f0d0
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-31 19:18:19 +02:00
Simone Bordet a08e953c74
Fixes #10087 - Flaky EventsHandlerTest due to trailers. (#10093)
* Fixes #10087 - Flaky EventsHandlerTest due to trailers.

HTTP/2 trailers may arrive and be processed before the application reads request chunks.

Avoid the race condition by storing the trailers aside and returning them during reads.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-13 08:19:03 +02:00
Greg Wilkins a3e82326cf
Experiment/jetty 12 chunk isError and warnings (#9904)
* Remove usage of instanceof Content.Chunk.Error
* Updated AsyncContent to accept a transient failures
* Updated AsyncContent to accept a transient failure with inputstream
2023-06-23 09:17:15 +02:00
Ludovic Orban 8e79c1b58b
Add `EventsHandler` API (#9901)
* #8885 add EventsHandler API

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-15 17:31:11 +02:00
Greg Wilkins 963d33111e
Jetty 12 idletimeout (#9905)
* IdleTimeout review

 + pass TimeoutException through all APIs
 + HttpConnection now passes on TimeoutException to HttpChannel.onFailure
* More ServerTests for idletimeout

* Recreated a ServerTimeoutsTest for multiple transports

* more robust tests

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

* merged work from @sbordet and @gregw

* Various improvements to CyclicTimeouts.
* Improved reset of the earliest timeout before iteration.
* Removed check for getExpireNanoTime() == -1, since it's a valid value.
* When onExpired(Expirable) returns false, the Expirable should arrange to move its timeout in the future.

* fix keystore to please BoringSSL + use correct temp path

Signed-off-by: Ludovic Orban <lorban@bitronix.be>

* Fixed ErrorResponseAndCallback succeeded() and failed() to call super.failed() in all cases to complete the wrapped callback.

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

* Revert "Fixed ErrorResponseAndCallback succeeded() and failed() to call super.failed() in all cases to complete the wrapped callback."

This reverts commit 5ac57c13e0.

* WIP idleTimeout

* WIP idleTimeout

* Added context wrapper for idle timeout listener

* updates from review

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-06-14 09:57:10 +02:00
Ludovic Orban 15d67bdf57 H3: disable using an IP(v4 or v6) address as the hostname as BoringSSL requires a SAN dns attribute for the IP addresses that keytool refuses to create
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-06 18:25:14 +02:00
Ludovic Orban cfc5c58bdb fix merge that missed setting the truststore and updating a test keystore
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-05-29 10:55:47 +02:00
Simone Bordet 8c4e75bf8d
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-28 00:34:49 +02:00
Ludovic Orban ac2765c98d Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-05-15 10:09:36 +02:00
Greg Wilkins 4c16e6a707
Jetty 12 content length 0 take3 (#9740)
* Optimize Content-Length: 0 handling

Create and use a pre-encoded HttpFields.CONTENT_LENGTH_0 constant
Used the constant in more places
renamed the `putLongField` methods of HttpFields.Mutable to just `put`
Fixed wrong docs examples
2023-05-07 19:22:15 +02:00