Commit Graph

182 Commits

Author SHA1 Message Date
Joakim Erdfelt d3af12957b
Updating to version 12.0.13-SNAPSHOT 2024-07-25 17:23:21 -05:00
Joakim Erdfelt cc6f1b74db
Updating to version 12.0.12 2024-07-25 16:57:59 -05:00
Ludovic Orban 8f5207e6ca
Fix broken client tls negotiation (#11999)
#11965 make EMPTY_BUFFER not read-only anymore

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-07-10 16:52:51 +02:00
Joakim Erdfelt f5abe07ade
Updating to version 12.0.12-SNAPSHOT 2024-06-27 19:09:24 -05:00
Joakim Erdfelt 9f90cedce3
Updating to version 12.0.11 2024-06-27 18:42:08 -05:00
Greg Wilkins 5e8cc2243e
Remove buffer from pool on write failure (#11951)
* Experiment with removable buffer from pool
* Changed remove return to be release boolean
* Fixes to avoid double release
* Tracking ByteBufferPool handles remove
* Adding assert on _channelState.isLockHeldByCurrentThread()

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-06-27 18:37:09 -05:00
Ludovic Orban 6d0bddc07a
#11932 make succeeded and failed in ICB final + introduce onSuccess
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-06-27 11:46:18 +02:00
Greg Wilkins 718c6fce51
Content.Source from methods (#11949)
Introduce Content.Source.from methods
These isolate code from specific implementations (which could even be made internal)
2024-06-25 12:32:29 +10:00
Greg Wilkins 4f4bec0624
ByteChannelContentSource (#11910)
Introduces a ByteChannelContentSource which is needed for the spring framework integration.

It also introduces a few minor utilities:

a ByteBufferPool.Sized class that is a ByteBufferPool.Wrapper with a configured size and type so a no args acquire() method can be called. This avoid the need to many classes to have a three fields: pool, size and direct and also can avoid constructors/methods with size and direct
an ExceptionUtil.run(Runnable, Consumer<Throwable> failure) that is a simple try catch and avoids many private methods being created to do just that.
2024-06-24 14:35:23 +10:00
Greg Wilkins d34556749f
Simplified Reactive Stream update for ContentSourcePublisher (#11849)
* Issue #11803 - Follow Reactive Streams specification
* Simplification of #11804 for Reactive Stream specification support

---------

Co-authored-by: Artem Golovko <artemgolovko98@gmail.com>
Co-authored-by: Olivier Lamy <olamy@apache.org>
2024-06-14 08:31:46 +10:00
Olivier Lamy fb1697fd07
Updating to version 12.0.11-SNAPSHOT 2024-05-30 15:23:16 +10:00
Olivier Lamy 26106dfc84
Updating to version 12.0.10 2024-05-30 14:39:40 +10:00
Simone Bordet a089fbf3ea
Fixes #9778 - Jetty 12 - Remove WriteFlusher.Listener. (#11839)
* Fixes #9778 - Jetty 12 - Remove WriteFlusher.Listener.

This listener is not necessary anymore, as the min data rate checks have been moved to a StatisticsHandler.MinimumDataRateHandler.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-05-29 10:13:25 +02:00
Simone Bordet 36cdc12ab7 Fixed JPMS declarations.
Some require transitive was missing, and has been added.
In other cases, making a field private (e.g. for log instances) made the warning go away.
In another case, removed explicit dependency on websocket core exception, as it was not necessary.

Clean up the POMs for jetty-eeN-annotations, that had unnecessary dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-05-23 22:06:01 +02:00
Greg Wilkins eafa7ab0d6
Fix #11756 empty byte array for no content in ChunkAccumulator (#11827)
Fix #11756 empty byte array for no content in ChunkAccumulator
2024-05-23 06:45:27 +10:00
Ludovic Orban c54141a4cb #11736 do not rethrow already thrown exception
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-05-13 12:05:10 +02:00
Joakim Erdfelt 8e7e42201a
Updating to version 12.0.10-SNAPSHOT 2024-05-03 09:28:36 -04:00
Joakim Erdfelt efe8023327
Updating to version 12.0.9 2024-05-03 09:02:37 -04:00
Greg Wilkins 8e456c4ee5
Improve javadoc to fix #11720 (#11731)
* Improve javadoc to fix #11720

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-05-03 08:51:30 -04:00
Ludovic Orban 656e904d91
Fix buffer leak in `HttpClientStreamTest.testUploadWithConcurrentServerCloseClosesStream()` (#10431)
Fix buffer leak in HTTP and FCGI when the server is being shut down while there are in-flight requests

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-04-22 16:15:58 +02:00
Greg Wilkins 33feac33e7
Revert "Revert NON_POOLING change" (#11649)
This reverts commit 2bf7d6cecc.
2024-04-18 15:52:03 +10:00
Joakim Erdfelt b3ef872d6b
Updating to version 12.0.9-SNAPSHOT 2024-03-29 15:20:11 -05:00
Joakim Erdfelt ffffdcc3c8
Updating to version 12.0.8 2024-03-29 14:31:57 -05:00
Greg Wilkins 9b6944e04a
Remove usages of URIUtil.toURI and URIUtil.split (#11577)
* Issue #11567 - fix relative path for resourceBase set in DefaultServlet

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

* Remove the ResourceFactory adaption from between baseResource and a HttpContent.Factory

* Remove toURI usage

* ensure ee9 DefaultServlet encodes the pathInContext

* Moved toURI functionality to ResourceFactory

* use context baseResource if baseResource not set

* removed usages of URIUtil.split

* fixed javadoc

* updates from review

* updates from review

* updates from review

* updates from review

* fixed resource leak in test

* fixed resource leak in test

* updates from review

* Fixes to URIUtil for Windows (#11585)

* Fixes for Windows
* Remove test that is not needed

* inlined resolveOrNew

---------

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-03-28 16:32:03 +01:00
Ludovic Orban 89c41b2550
Cleanup Resource IO (#11364)
Refactorings to rationalize and simplify how we do IO with resources internally by introducing the IOResources helper.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-03-28 11:08:44 +01:00
Simone Bordet 258a5e04de
Fixes #10870 - How to set HttpConfiguration.securePort when the HTTPS port is dynamic? (#11547)
Introduced NetworkConnector.Listener to notify of open/close events.
Applications can register a listener on one NetworkConnector, be notified when it opens, and configure other components (for example using the NetworkConnector.localPort).

Cleaned up ManagedSelector.CloseConnections, which had code that was not used, and fixed the close of non-connection elements such as the ServerSocketChannel and DatagramChannel (when acceptors=0).

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-03-24 20:52:56 +01:00
Greg Wilkins 51fc906d37
Optimized ReservedThreadExecutor with ThreadIdPool (#11498)
* Introduced ThreadIdPool and replaced ThreadLocal with it
 * Modified ReservedThreadExecutor to be backed by a ThreadIdPool of semaphores

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: gregw <gregw@webtide.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2024-03-21 16:53:14 +01:00
Greg Wilkins c05ae3bb83
Implemented addBeanFromConstructor (#11319)
Added mechanism to safely add beans from a super constructor of ContainerLifeCycle


Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-03-13 17:52:55 +01:00
Joakim Erdfelt 18b2a7c201
Updating to version 12.0.8-SNAPSHOT 2024-02-29 16:00:27 -06:00
Joakim Erdfelt c89aca8fd3
Updating to version 12.0.7 2024-02-29 15:18:56 -06:00
Joakim Erdfelt 54aaa3a398
Improve DEBUG during WebInfConfiguration.unpack 2024-02-27 10:15:24 -06:00
Simone Bordet 24c1140917
Fixes #8979 - Jetty 12 - HttpClientTransport network "modes". (#11368)
* Introduced oej.io.Transport as the abstraction for the low-level transport of high-level protocols.
Now protocols such as HTTP/1.1 or HTTP/2 can be transported over TCP, QUIC, Unix-Domain, memory, and possibly over other low-level custom protocols too.
* Introduced oej.client.Request.transport(Transport) to specify Transport for each request.
* Introduced Transport to [HTTP2Client|HTTP3Client].connect(...) methods.
* Introduced [Client|Server]QuicConfiguration so that it can be used in other Connectors such as MemoryConnector.
* Introduced oej.server.MemoryConnector and EndPoint.Pipe for memory communication between peers, along with a MemoryTransport.
* Introduced QuicTransport as a wrapper for other Transports, so that QUIC can now also be transported over memory.
* Improved javadocs and documentation.
* Removed usage of ClientConnector.forUnixDomain() from FastCGIProxyServlet (ee10 and ee9).
* Replaced usage of HTTP3ServerConnector with QuicServerConnector in jetty-http3.xml.
* Fixed handling of Instruction notifications in case of re-entrance.
Now first clear the list, then notify to avoid that when re-entering the same instruction is notified multiple times.
* Introduced ContentSourceRequestContent, and updated ProxyHandler to use it.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-26 17:24:24 +01:00
Simone Bordet 535e772c7e Updated code to use new UnixDomain APIs explicitly, rather than via reflection.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-23 18:47:24 +01:00
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
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 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
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
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
Joakim Erdfelt 82d9177f0c
Updating to version 12.0.7-SNAPSHOT 2024-01-29 21:04:51 -06:00
Joakim Erdfelt 78ab6e6ba1
Updating to version 12.0.6 2024-01-29 20:42:49 -06:00
Greg Wilkins c6c5f07d51
Fixes for Spring core integration (#11288)
* Cleanup of HttpFields to improve spring integration

* Fixed Subscriber for spring integration

* Fixed implementation of ContentSinkSubscriber.
Added comment to clarify behavior of ContentSinkPublisher.

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

* Apply suggestions from code review

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

* updates from review

* updates from review

* updates from review

* updates from review

* fix canRetain

* updates from review

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-01-26 12:18:51 +09:00
Simone Bordet aa21612006
Fixes #11282 - Deadlocks with DEBUG logging enabled in jetty-server testing.
Introduced AutoLock.tryLock() to use it in the toString() implementations that lock in order to retrieve a consistent state to produce the string.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-23 22:04:57 +01:00
Simone Bordet 80a04a554f
Fixes #11098 - Sporadic NPE in ArrayByteBufferPool.evict(). (#11204)
* Reorganized ArrayByteBufferPool.evict() code to avoid NPE.
* Fixed acquire logic to take into account that a reserved entry may fail to be enabled because it may be concurrently removed.
* Small change to ConcurrentPool: no need to null check the final ConcurrentEntry.holder field.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-03 15:56:36 +01:00
Lachlan 965e4af425
Merge pull request #11083 from jetty/jetty-12.0.x-11080-multipartRetainableChunks
Issue #11080 - copy ByteBuffer for non-retainable chunks
2023-12-20 12:19:30 +11:00
Lachlan Roberts 592ccf7da0 Issue #11080 - copy ByteBuffer for non-retainable chunks
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-12-19 15:11:43 +11:00
Joakim Erdfelt 96eea590ee
Updating to version 12.0.6-SNAPSHOT 2023-12-18 08:25:22 -06:00
Joakim Erdfelt 3aed62e495
Updating to version 12.0.5 2023-12-18 08:05:54 -06:00
Joakim Erdfelt 9a044fda67
Merge remote-tracking branch 'release/12.0.4' into jetty-12.0.x 2023-12-04 16:12:09 -06:00
Ludovic Orban 5b30fee459 Allocate the one byte array only when needed
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-12-04 19:26:46 +01:00
Ludovic Orban 8484a9da70 Fix ContentSourceInputStream mis-behaving in the presence of empty chunks
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-12-04 19:26:46 +01:00