Commit Graph

1126 Commits

Author SHA1 Message Date
Simone Bordet 302ea04cca
Fixed `ProxyWriter` concurrency, now using IteratingCallback to avoid races.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-11-18 15:53:36 +01:00
Simone Bordet 41cf4532f5
Fixes #12323 - AsyncMiddleManServlet response flushing.
* Fixed `ProxyWriter.chunks` locking.
* Made `writeProxyResponseContent()` protected so it can be overridden to flush the response content.
* Added test case.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-11-15 18:43:07 +01:00
Lachlan 24580b3fe7
Merge pull request #12516 from jetty/jetty-12.0.x-12429-caseInsensitiveHeadersWebSocket2
WebSocket cleanups from PR #12441
2024-11-15 14:13:10 +11:00
Simone Bordet dde369a7f2 Issue #12272 - Potential deadlock with Vaadin.
Fixed the case where a GOAWAY followed by a TCP FIN was causing a race between closing the `EndPoint` and running the failure `Runnable` task.

The TCP FIN after the GOAWAY causes the streams to be failed on the server;
in turn, failing the streams generates failure `Runnable` tasks that are submitted to the HTTP/2 execution strategy;
however, the streams were destroyed before the failure `Runnable` tasks actually ran, so the `EndPoint` was closed;
closing the `EndPoint` would close the `HTTP2Connection`, which in turn would stop the execution strategy;
this lead to the fact that the failure `Runnable` tasks were never run.

Now, the failure `Runnable` tasks are invoked via `ThreadPool.executeImmediately()` rather than being submitted to the execution strategy.
This ensures that they would be run and not queued, even in case of lack of threads, so that they could unblock blocked reads or writes, freeing up blocked threads.

Additionally, improved `HTTP2Stream.onFailure()` to destroy the stream only after the failure tasks have completed.

Smaller other fixes to improve the code.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-11-12 16:24:23 +02:00
Lachlan Roberts 502f511bfb
WebSocket cleanups from PR #12441
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-11-12 15:36:20 +11:00
Lachlan b57b8e689f
Merge pull request #12441 from jetty/jetty-12.0.x-12429-caseInsensitiveHeadersWebSocket
Issue #12429 - case-insensitive headers for websocket
2024-11-12 14:56:12 +11:00
Simone Bordet c064dd5d1b
Fixes #12496 - MultiPartFormData.Parser question. (#12500)
* Deprecated MultiPartFormData.Parser.parse() with 2 Promises, a leftover from previous experiments.
* Added @deprecated javadoc tag to deprecated methods, indicating what to use instead.
* Updated documentation to use non-deprecated APIs.
* Updated source code to use non-deprecated APIs.
* Updated class javadocs with usage examples that were outdated.
* Made Blocker.Promise extends Promise.Invocable, so it can be use to block while using asynchronous APIs.
* Added missing methods that perform asynchronous operation using a Promise rather than CompletableFuture.
* Added servlet-to-handler examples for form fields and multipart.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-11-08 09:53:34 +01:00
Lachlan Roberts 7eb54fa9aa
PR #12441 - changes from review
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-11-08 11:24:51 +11:00
Lachlan Roberts 89cc46f500
PR #12441 - changes from review
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-11-07 16:38:18 +11:00
Joakim Erdfelt 8ee9336372
Updating to version 12.0.16-SNAPSHOT 2024-11-05 14:01:49 -06:00
Joakim Erdfelt 8281ae9740
Updating to version 12.0.15 2024-11-05 13:44:38 -06:00
Lachlan Roberts d04917f614
PR #12441 - changes from review
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-11-05 13:08:09 +11:00
Alexander Farber e2333ea6a0
Change org.eclipse.jetty.ee9.servlets to org.eclipse.jetty.ee10.servlets in the commented lines (#12470)
Signed-off-by: Alexander Farber <farber72@outlook.de>
2024-11-04 10:28:12 +10:00
Lachlan Roberts 9cd93bdc32
PR #12441 - changes from review
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-11-01 16:29:41 +11:00
Lachlan Roberts 4635b572ca
PR #12441 - changes from review
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-11-01 15:15:13 +11:00
Lachlan Roberts 7459532247
PR #12441 - fix bad line in AnnotatedClientEndpointTest
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-10-31 23:59:48 +11:00
Lachlan Roberts 7757941aad
PR #12441 - Allow HttpFields.asMap to modify the underlying HttpFields
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-10-31 17:03:05 +11:00
Lachlan Roberts ec94ca551e
PR #12441 - fix error handling in WebSocketCreator implementations
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-10-31 14:04:52 +11:00
Ludovic Orban 94c3f9da39
Restore thread starvation tests (#12395)
For #12214 restore ee9 and ee10 thread starvation tests

* Deprecated ContentSourceCompletableFuture and added protection to method to match invocation type
* more demand invocables with invocation type
* Deprecated the CF APIs and replaced with explicit getXxx onXxx methods
* replace FutureCallback and FuturePromise usages with Blocker.* instead
* Converted new API on FormFields to use Promise
* Modified SerializedInvoker to take into account the task InvocationType.
* Added ThreadStarvationTest for all transports, to check that also HTTP/2 and HTTP/3 do not starve in case of non-blocking reads.
* Improved Core ThreadStarvationTest
* Fixed AsyncServletLongPollTest in ee9 and ee10 to match the current behavior in case of close.
* Removed Invocable.InvocableCompletableFuture
* Fixed SerializedInvoker.
* Improved ThreadStarvationTest.
* refined more DemandTask implementations
* Added InvocableType.runWithoutBlocking (name is WIP)
* replace Thread.sleep() with awaitility

---------

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: gregw <gregw@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-10-31 12:01:15 +11:00
Simone Bordet 85ce1521c1
Fixes #5685 - AsyncProxyServlet calls onProxyResponseSuccess() when internally it throws "Response header too large" exception. (#12351)
* Introduced "maxResponseHeadersSize" parameter to AbstractProxyServlet.
* Introduced HttpGenerator.maxResponseHeadersSize and added checks to not exceed it.
* Fixed HttpParser to generate a 400 in case HttpParser.maxHeaderBytes are exceeded for a response.
* HTTP2Flusher now resets streams in case of failures.
* Removed cases in HTTP2Session where a GOAWAY frame was generated with lastStreamId=0.
  GOAWAY.lastStreamId=0 means that not a single request was processed by the server, which was obviously incorrect.
* Written tests for both ProxyHandler and ProxyServlet about max response headers size exceeded.
* Simplified server-side response header allocation for HTTP/1.1.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-10-30 18:17:24 +01:00
Lachlan Roberts 8ff682820e
Issue #12429 - case-insensitive headers for websocket
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-10-30 11:52:30 +11:00
Simone Bordet 26f660f0fd Fixes #12313 - Jetty 12 ee9/ee10 doesn't invoke callbacks when h2 client sends RST_STREAM.
* Fixed invocation of AsyncListener.onError(), now called even if the response is already committed, in both EE9 and EE10.
* Reworked EE9 HttpChannel state machine in case of failures to be like EE10's.
  In particular, calling abort now is a state change, rather than a failure of the Handler callback.
  In this way, the handle() loop continues, enters case TERMINATED, and the callback is completed in onCompleted().
* Fixed EE9 handling of idle timeout in HttpChannel.onRequest(), that was missing.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-10-24 15:27:10 +02:00
Lachlan afdbad5f76
Merge pull request #12337 from jetty/jetty-12.0.x-11492-AutoAdd-AliasChecker
Issue #11492 - Auto-add AliasChecker for custom Base Resource from ResourceServlet
2024-10-21 21:09:23 +11:00
Olivier Lamy 14b277b69f
Jetty 12.0.x dependencies upgrade (#12376)
* some dependencies upgrade
---------
Signed-off-by: Olivier Lamy <olamy@apache.org>
2024-10-17 13:56:23 +10:00
Jan Bartel 99c9db2b00
Issue #12385 Update ee10 jsp to Apache Jasper 10.1.31 (#12386) 2024-10-16 09:30:33 +11:00
Greg Wilkins 50bced4c35
Fix #12356 Do not send keep-alive when not persistent (#12375)
Fix #12356 Do not send keep-alive when not persistent

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-10-16 07:39:27 +11:00
Olivier Lamy 41f35ea464
should fix interpolation
Signed-off-by: Olivier Lamy <olamy@apache.org>
2024-10-10 10:02:06 +10:00
Olivier Lamy 52c6a743ae
use variables
Signed-off-by: Olivier Lamy <olamy@apache.org>
2024-10-10 09:45:15 +10:00
Joakim Erdfelt 64a4170132
Update commons-io to address CVE
+ Fixes for CVE-2024-47554
2024-10-09 14:49:50 -05:00
Lachlan Roberts 0b12df878d
PR #12337 - changes from review
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-10-09 11:25:43 +11:00
Lachlan Roberts 3fd5f32e45
PR #12337 - fix checkstyle error
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-10-02 12:34:51 +10:00
Lachlan Roberts 02227df7fb
Issue #11492 - Auto-add AliasChecker for custom Base Resource from ResourceServlet
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
2024-10-01 16:08:06 +10:00
Joakim Erdfelt e9d61a1686
Updating to version 12.0.15-SNAPSHOT 2024-09-30 09:42:49 -05:00
Joakim Erdfelt e77516598a
Updating to version 12.0.14 2024-09-30 09:22:20 -05:00
Jan Bartel 97ff5486ff
Jetty 12.0.x 12191 alt debug listener (#12254)
* Issue #12191 reinstate debug listener modules

---------

Co-authored-by: Greg Wilkins <gregw@webtide.com>
2024-09-30 17:15:20 +10:00
Joakim Erdfelt f4c38c433e
Issue #11092 - Allow MetaInfConfiguration parsing of `java.class.path` to support globs (#12287)
* Issue #11092 - Allow MetaInfConfiguration parsing of java.class.path to support globs
* Work with unwrapped URIs for uriPredicate (and test assertion)
2024-09-26 06:40:29 -05:00
Jan Bartel ba0ba99919
Issue #12315 fix flakey session AsyncTest (#12316) 2024-09-26 16:45:59 +10:00
gregw 018647d873 Added test for #11298 2024-09-25 10:42:16 +10:00
Greg Wilkins 18b9782550
Avoid list copy on reverse iteration (#12297)
This reverts/modified parts of commit 115ee1cf39.

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>

---------

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-09-25 07:43:01 +10:00
Ludovic Orban cbc3ac01f2 #11841 add reproducer using jetty client
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-09-23 13:27:26 +02:00
Simone Bordet 115ee1cf39
Fixes #12289 - Improve ConcurrentPool concurrency. (#12290)
A call to `sweep()`, although protected by the lock for concurrent calls to `reserve()`, may be concurrent with `remove(Entry)`.

`remove(Entry)` in turn calls `entries.remove(Object)`, so that the concurrent iteration in `sweep()` over `entries` fails with an `ArrayIndexOutOfBoundsException`.

Now using the bulk `entries.removeIf(Predicate)` method in `sweep()`, so that sweeping is atomic with respect to `entries.remove(Object)`.

Fixed other occurrences of manual iteration over CopyOnWriteArrayList that may be concurrent with removals.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-09-20 15:50:39 +02:00
Jan Bartel 41333a7712
Issue #12255 Dump CookieConfig (#12257) 2024-09-18 06:57:30 -05:00
Joakim Erdfelt 044a3be744
Merge pull request #12245 from jetty/release/12.0.13
Merge back release 12.0.13
2024-09-11 09:45:12 -05:00
Simone Bordet 24f0ac28ad Fixes #11327 - Flaky test ServletTest.testSimpleIdleRead().
Just improving the test code.
The flakyness was likely fixed by the work in #12216 and #12237.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-09-10 12:03:02 +03:00
Simone Bordet fa0502db54
Fixes #12249 - HTTP/2 responses with Content-Length may have no content. (#12250)
Fixed HttpReceiverOverHTTP2.read() to return a failed chunk if the stream has been reset.
This closes the window where a RST_STREAM frame may be received, drain the DATA frames in HTTP2Stream, and the application reading exactly at that point.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-09-09 17:20:17 +02:00
Simone Bordet c2519bbf48 Fixes #11581 - Flaky WebSocketOverHTTP2Test.testWebSocketOverDynamicHTTP2()
Marked the test as flaky, actual resolution needs resolving #12235.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-09-05 13:16:23 +03:00
Olivier Lamy 65e9bba44c
next snapshot
Signed-off-by: Olivier Lamy <olamy@apache.org>
2024-09-03 21:44:43 +10:00
Olivier Lamy 816018a420
Updating to version 12.0.13 2024-09-03 13:03:43 +10:00
Lachlan 899c005e34
Merge pull request #12208 from jetty/jetty-12.0.x-11434-AliasCheckerSymlinkTests
Issue #11434 - resolve differences in AliasCheckerSymlinkTests
2024-09-03 10:02:56 +10:00
Ludovic Orban 5439f17ff6
Rework leak tracking assertions to use a common awaitility pattern (#12226)
Rework leak tracking assertions to use a common awaitility pattern

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-09-02 19:34:05 +02:00