Commit Graph

2188 Commits

Author SHA1 Message Date
Joakim Erdfelt ea2a76ed3b Updating to version 9.4.38-SNAPSHOT 2021-02-19 09:44:28 -06:00
Joakim Erdfelt 27afab2bd3 Updating to version 9.4.37.v20210219 2021-02-19 09:03:57 -06:00
Joakim Erdfelt 176e29e408
Happy New Year 2021
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2021-01-21 12:31:00 -06:00
Joakim Erdfelt 2e53ec5384 Updating to version 9.4.37-SNAPSHOT 2021-01-14 11:27:24 -06:00
Joakim Erdfelt 238ec6997c Updating to version 9.4.36.v20210114 2021-01-14 10:29:28 -06:00
Ludovic Orban 0dec883fda implement connection pool max duration 2021-01-12 15:41:56 +01:00
Simone Bordet 6e1cd862e4
Fixes #5845 - Use UTF-8 encoding for client basic auth if requested. (#5847)
* Fixes #5845 - Use UTF-8 encoding for client basic auth if requested.

* Introduced get/setCharset in BasicAuthenticator on server-side.
* Looking for the "charset" parameter on the client-side, and if there, use it.
* Added test case.
* Code cleanups.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-01-12 11:26:33 +01:00
Simone Bordet 403d5ec318
Fixes #5855 - HttpClient may not send queued requests. (#5856)
Changed the AbstractConnectionPool.acquire() logic to call tryCreate() even
when create=false.

This is necessary when e.g. a sender thread T2 with create=true steals a
connection whose creation was triggered by another sender thread T1.
In the old code, T2 did not trigger the creation of a connection, possibly
leaving a request queued.
In the new code, T2 would call tryCreate(), possibly triggering
the creation of a connection.

This change re-introduces the fact that when sending e.g. 20 requests
concurrently, 20+ connections may be created.

However, it is better to err on creating more than creating less and leaving
requests queued.

Further refactoring moved field pending from Pool to AbstractConnectionPool.
As a consequence, AbstractConnectionPool.tryCreate() now performs a 
demand/supply calculation to decide whether to create a new connection.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
2021-01-07 16:05:24 +01:00
Simone Bordet 5a28c7484a Avoid that tests wait indefinitely.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-01-06 11:34:30 +01:00
Olivier Lamy 639cad63fe
Jetty 9.4.x optimize parser warning from logs and add spotbug (#5735)
* enable spotbugs in CI

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

record issues

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

use warning new generation

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

activate errorprone

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

fix Jenkinsfile

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

do not run spotbugs for jetty-runner as we do not want to fix all dependencies bugs :)

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

junit should allow empty results

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

maven console can be use only once...

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

one liner

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

recordissues only once

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

force id

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

aggregate results

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

configure a name for aggregated reports

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

mo more -T3 no need anymore of remote session test profile

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

I want to see what failing tests look like with new report.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

skip spotbugs for jetty-jmh

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

get rid of findbugs as we now have spotbugs

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

Revert "I want to see what failing tests look like with new report."

This reverts commit df0d13e4c53d7461872e1f925ec06bd36e4a66c9.

activate errorProne parser

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

make pmd quiet for CI

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

remove -fae flag and do not display transfer progress

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

try junitParser() to see what it does

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

junit parser is a bad idea...

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

increase timeout

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

no -T2 for javadoc

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

fix skip spotbugs and pmd verbose

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

* remove -T options

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-12-11 11:47:26 +10:00
Joakim Erdfelt e8683cba9f Updating to version 9.4.36-SNAPSHOT 2020-11-20 16:05:27 -06:00
Joakim Erdfelt bdc54f03a5 Updating to version 9.4.35.v20201120 2020-11-20 15:05:50 -06:00
Simone Bordet a308881fab Fixes #5633 - Allow to configure HttpClient request authority.
Introduced HttpDestination.send(Request, Response.CompleteListener) to send a request using the given destination.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-11-11 17:13:00 +01:00
Joakim Erdfelt edaadff55b Updating to version 9.4.35-SNAPSHOT 2020-11-02 09:04:51 -06:00
Joakim Erdfelt e46af88704 Updating to version 9.4.34.v20201102 2020-11-02 08:03:51 -06:00
Joakim Erdfelt b480a97b44
Issue #5519 - Disable problematic HttpClientTLSTest.testMismatchBetweenTLSProtocolAndTLSCiphersOnClient test
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-10-27 16:58:05 -05:00
Joakim Erdfelt af31eac07e
Disabling SslBytesClientTest due to JDK 8u272 differences. 2020-10-27 16:03:20 -05:00
olivier lamy fda530444c Revert "add surefire timeout for httpclient test"
This reverts commit 6845947bbf.
2020-10-27 11:55:35 +10:00
olivier lamy 6845947bbf add surefire timeout for httpclient test
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-10-27 08:39:32 +10:00
Joakim Erdfelt e726eefb0b Updating to version 9.4.34-SNAPSHOT 2020-10-20 18:55:39 -05:00
Joakim Erdfelt 1be6875565 Updating to version 9.4.33.v20201020 2020-10-20 18:28:51 -05:00
Simone Bordet c5df807b6d Fixes #5409 - HttpClient fails intermittently with "Invalid response state TRANSIENT".
The problem was a race condition during content decoding.
Since decoding needs to be done in a loop, the condition to loop is to
check whether there is demand for the next chunk of decoded content.

Checking for demand also sets the stalled flag, and this must be done
only after the response state has been set back to CONTENT.
Unfortunately this was not done in the decoding loop.

The fix is to always update the response state in the decoding loop.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-10-13 23:18:26 +02:00
Joakim Erdfelt bc641dcd22
Merge pull request #5332 from eclipse/dependabot/maven/jetty-9.4.x/org.apache.kerby-kerb-simplekdc-2.0.1
Bump kerb-simplekdc from 1.1.1 to 2.0.1
2020-10-08 09:46:54 -05:00
dependabot[bot] 7cca195801
Bump kerb-simplekdc from 1.1.1 to 2.0.1
Bumps kerb-simplekdc from 1.1.1 to 2.0.1.

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-30 18:51:32 +00:00
Joakim Erdfelt 85e257fc98 Updating to version 9.4.33-SNAPSHOT 2020-09-30 11:53:09 -05:00
Joakim Erdfelt de97d26f7b Updating to version 9.4.32.v20200930 2020-09-30 11:03:24 -05:00
Joakim Erdfelt 3423375a97
Issue #5357 - Updating to https://eclipse.org/ (#5358)
* Issue #5357 - Updating to https://eclipse.org/

 - Removing redundant <url> refs in pom.xml
 - Correcting bad indenting from merge
 - Correcting mailing list references
 - Correcting bugs.eclipse.org references
 - Correcting text file references
 - Correcting html references
 - Correcting further references
 - Correcting download.eclipse.org reference
 - Adding test for demo-base /proxy/current/
 - Ensuring jetty-client is included in javadoc-proxy.war/WEB-INF/lib

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-09-29 11:02:32 -05:00
Lachlan Roberts a3090a61e8 Issue #5170 - backport fix to websocket upgrade from jetty-10
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-09-22 18:25:11 +10:00
Greg Wilkins ba22c08fde
Alternative Pool Strategies (#5218)
* Speculative idea to make a pluggable Pool strategy

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

* Speculative idea to make a pluggable Pool strategy

 + javadoc

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

* Speculative idea to make a pluggable Pool strategy

 + Added a ThreadLocalStrategy for a single cached item
 + Tell strategies about newly reserved entries
 + Fixed multiplexing test that was dependent on the impl of the cache

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

* Speculative idea to make a pluggable Pool strategy

 + added tests

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

* Feedback from review

 + Don't have a fallback iteration, instead make a SearchStrategy and DualStrategy

* Feedback from review

 + split strategies into Cache and Strategies

* Feedback from review

 + Added reserve and release

* Improved Pool Strategies:

+ reverted to post notifications for removed, reserved and released.
+ Added a few more strategies that need to be benchmarked, that use the list iterator.

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

* Testing all the different strategies

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

* More simplifications and made LRU work (ish)

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

* javadoc

* More javadoc

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

* JMH Test

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

* one strategy

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

* test

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

* Split implementations:

 + pluggable strategies
 + hard coded

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

* More benchmarks

* Built in strategy

* removed strategies version and simplified to single configurable solution.

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

* updates from review

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

* better javadoc

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

* Updated ConnectionPool classes to use Pool strategies

* Small javadocs fixes.

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

* Updates from review

* javadoc

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2020-09-16 18:27:26 +02:00
Simone Bordet f81bf7f945
Fixes #3766 - Introduce HTTP/2 API to batch frames. (#5222)
* Fixes #3766 - Introduce HTTP/2 API to batch frames.

Introduced Stream.FrameList to hold HEADERS+DATA+HEADERS frames.
These are often used by the client and by the server when the
request/response content is known and FrameList will allow to
send them in a single TCP write, rather than multiple ones.

Rewritten HttpSenderOverHTTP2.sendHeaders() and
HttpTransportOverHTTP2.sendHeaders() to take advantage of
FrameList.

Now using ConcurrentHashMap as a client context, because
with DEBUG logging enabled it may be access concurrently.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-09-10 10:13:14 +02:00
Simone Bordet 01135e1515
Fixes #5217 - Review RoundRobinConnectionPool (#5219)
* Fixes #5217 - Review RoundRobinConnectionPool

Introduced IndexedConnectionPool and RandomConnectionPool.
Clarified semantic of RoundRobinConnectionPool.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-09-09 15:31:28 +02:00
Simone Bordet 7cf605839b
Merge pull request #5166 from eclipse/jetty-9.4.x-5152-handle_unsolicited_response
Fixes #5152 - HttpClient should handle unsolicited responses.
2020-08-26 08:41:14 +02:00
Simone Bordet 0af5f676cd Issue #5147 - HTTP2 RoundRobinConnectionPool with maxUsage
Reworked HTTP/2 release after an exchange is terminated.

Previously, the release was bound to 2 events: onStreamClosed(),
introduced for #2796, and exchangeTerminated().
Unfortunately, if the former happens before the latter and
closes the connection, the latter will see the exchange as
aborted, while in fact it was successful, causing what
reported in #5147, an AsynchronousCloseException.

Now, the release is always performed by the exchangeTerminated()
event. With respect to #2796, the stream is always already
closed by the time the exchangeTerminated() event fires (it
was not before).

Reworked the implementation of RoundRobinConnectionPool using
a lock and aggressively trying to open new connections.

A second fix is related to HttpDestination.release(Connection).
If the connection is closed for e.g. overuse, we need to trigger
the processing of queued requests via send(create: true).

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-22 22:10:08 +02:00
Simone Bordet 2d3f0e0c10 Improved logging and toString() implementations,
small refactorings in code and tests.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-22 17:31:12 +02:00
Simone Bordet c88aba6587 Fixes #5152 - HttpClient should handle unsolicited responses.
Now closing the connection if an unsolicited response is detected,
no matter what response status code, or whether it has a
Connection: close header, or whether it's just random bytes from
the server, and also no matter whether the client read -1.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-18 12:18:20 +02:00
Simone Bordet 0646e4d0b5 Fixes #5165 - Wrong messagesIn count for HttpClient.
Now incrementing inMessages only when the response is complete.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-18 11:41:18 +02:00
Simone Bordet a6e1f9df8f
Merge pull request #5151 from olegmoz/5150-zero-connection-timeout
Issue #5150 - Infinite connection timeout support in ManagedSelector
2020-08-14 18:32:52 +02:00
Oleg Mozzhechkov 32fe19a5e0 #5150 - Code style fix and connect timeout docs update
Signed-off-by: Oleg Mozzhechkov <oleg.mozzhechkov@gmail.com>
2020-08-13 21:23:31 +03:00
Simone Bordet edbc1930b9 Issue #4809 - Set a max number of requests per connection.
Added test case for idle connections not used for any request.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-13 19:39:27 +02:00
Simone Bordet 4a0af046b8 Closes #4809 - Set a max number of requests per connection.
Implemented as part of #4975.

Added a test case that proves that the connection is closed
when the max usage count is reached.

Improved logging.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-12 16:14:51 +02:00
Greg Wilkins 25e3f1c1e0
Pool class refinements (#5117)
* Some updates to the new Pool class:

 + fixed a race with pending reservations
 + use a pending counter
 + Reservation API to simplify Entry API
 + removed public methods on Entry API

* Some updates to the new Pool class:

 + fixed a race with pending reservations
 + use a pending counter
 + Reservation API to simplify Entry API
 + removed public methods on Entry API

* Updates from review

* Updates from review
Tests for cache size and acquire with creator

* Method no longer required with Reservation

* update from the feedback on the feedback of the feedback from the review.

Moved enable to Entry, removed Reservation class and clarified usage in javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

fixed javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

fixed javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

fixed javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

updates from review
2020-08-12 11:27:25 +02:00
Simone Bordet 2e73f80d34 Fixes #5079 - :authority header for IPv6 address not having square brackets.
Reverted code changes to HttpClient.normalizeHost().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-11 20:03:42 +02:00
Simone Bordet 897e766f24 Fixes #5079 - :authority header for IPv6 address not having square brackets.
Updates after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-11 19:18:11 +02:00
Simone Bordet d53d9d8a1d Fixes #5079 - :authority header for IPv6 address not having square brackets.
On the client:
* Origin.Address.host is passed through HostPort.normalizeHost(),
so that if it is IPv6 is bracketed.
Now the ipv6 address passed to an `HttClient` request is bracketed.
* HttpRequest was de-bracketing the host, but now it does not anymore.

On the server:
* Request.getLocalAddr(), getLocalName(), getRemoteAddr(),
getRemoteHost(), getServerName(), when dealing with an IPv6 address,
return it bracketed.
The reason to return bracketed IPv6 also from *Addr() methods is that
if it is used with InetAddress/InetSocketAddress it still works, but
often it is interpreted as a URI host so brackets are necessary.
* DoSFilter was blindly bracketing - now it does not.

Added a number of test cases, and fixed those that expected
non-bracketed IPv6.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-07 15:53:19 +02:00
Simone Bordet 1f14dfa427 Code cleanups.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-06 11:23:48 +02:00
Ludovic Orban e9dad975e6 Re-implement HTTP connection pooling with a non-queuing algorithm
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2020-07-31 10:36:43 +02:00
Joakim Erdfelt fe9deae849 Updating to version 9.4.32-SNAPSHOT 2020-07-23 13:53:47 -05:00
Joakim Erdfelt 450ba27947 Updating to version 9.4.31.v20200723 2020-07-23 12:46:54 -05:00
gregw 88ec429b9c Issue #5053
removed weak random from digest.
2020-07-17 13:02:46 +02:00
gregw f6d39849e8 Improves #5053 by giving option of secure or pseudo random
Allow random to be passed in and can default to a weak pseudo random.
2020-07-17 12:19:22 +02:00