Commit Graph

1608 Commits

Author SHA1 Message Date
Greg Wilkins cf0b6140fe
Merge pull request #2299 from olamy/feature/available_processors
#2298 Override the processor number with an environment variable
2018-03-08 08:36:52 +11:00
Simone Bordet a3100e0211 Issue #2288 - Cleanup the statistics classes. (#2290)
* Issue #2288 - Cleanup the statistics classes.

Cleaned up code, added Javadocs.
Renamed SampleStatistics.set(long) to record(long).

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

* toString stddev

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-03-08 08:35:21 +11:00
olivier lamy 7004aaa538 #2298 Override the processor number with an environment variable
Signed-off-by: olivier lamy <olamy@webtide.com>
2018-03-07 21:02:26 +10:00
Greg Wilkins 5216d07124 Better dump for ManagedSelector
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-03-07 18:06:57 +11:00
Greg Wilkins bcb9fa3b32
Merge pull request #2257 from lachlan-roberts/jetty-9.4.x-2206-ReferenceEquality
Resolved errorprone ReferenceEquality warnings #2206
2018-03-07 11:11:40 +11:00
Greg Wilkins daeaad7624 improve test timing
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-03-06 19:03:46 +11:00
Greg Wilkins 2291d12b87 more robust idle test
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-03-06 15:34:42 +11:00
Greg Wilkins f6d9393bb5 more robust test by avoiding sleep
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-03-06 14:35:31 +11:00
Lachlan Roberts 020ebde77c found additional ReferenceEquality warnings which have been resolved
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-03-06 14:28:11 +11:00
Joakim Erdfelt 2879d5a5a0
Merge pull request #2277 from eclipse/jetty-9.4.x-2255-notify_ssl_handshake_on_write_failures
Issue #2255 - Notify SSL handshake failures on write failures.
2018-03-02 09:45:38 -06:00
Lachlan Roberts a639ee9275 Resolved errorprone MissingOverride warnings #2206
`@Override` was added to methods which were missing the annotation #2206

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-03-01 13:59:25 +11:00
Simone Bordet 718ac76815 Issue #2255 - Notify SSL handshake failures on write failures.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-02-28 21:32:42 +01:00
Lachlan Roberts 480c0e718a Merge branch 'jetty-9.4.x' into jetty-9.4.x-2206-ReferenceEquality 2018-02-28 16:14:49 +11:00
Lachlan Roberts 0cfc25d4ed Resolved errorprone ReferenceEquality warnings #2206
Objects which inherit or implement an `equals()` method should not be compared with == or !=
When the comparison of references is intentional `@SuppressWarnings("ReferenceEquality")` can be used

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2018-02-28 14:26:02 +11:00
Simone Bordet f4b82755ad Now also logging the readyOps of the key that has been selected.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-02-27 12:03:36 +01:00
Greg Wilkins 0cb4f5629d
Jetty 9.4.x 1803 proposal 0+2 (#2199)
Merging this PR for #2199 as we currently think it is not worse than previous and the code base is definitely simpler.   While JMH has shown significant benefits for this approach, we have yet been able to demonstrate them in full scale integration tests - however that is likely due to GC and thread pool issues dominating.

A `org.eclipse.jetty.http2.PEC_MODE` System property has been added to allow the EWYK scheduling to be disabled for HTTP/2 if need be.


* Implementation of #1803 proposal 2 - EITHER dispatch type for EWYK
* made code more readable
* increase small threadpools in tests for extra reserved thread
* clean up
* minor code simplifications
* Work in progress to simplify reserved thread pool
* use a single ReservedThreadPool built into the QueuedThreadPool
* fixed javadoc
* removed more old reserved thread references
* disable EWYK for h2
* fixes from review
* use EWYK for HTTP2
* Fixed javadocs, imports and QueuedThreadPool constructors.
* fix javadoc
* EWYK avoid unnecessary pendings
* after review
* fixed merge with jetty-threadpool.xml
* alternate EWYK implementations
* added jetty copyright headers
* Simplified EWYK code after review
* fixed bad merge
* Code cleanups.
* Improved Javadocs for deprecated property "reservedThreads".
* Improved Javadocs for deprecated property "reservedThreads".
* added a system property to enable only PEC for HTTP/2

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-02-27 14:29:59 +11:00
Greg Wilkins 8bd27cd18a improved or ignored tests #2230
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-02-23 14:52:37 +11:00
Greg Wilkins c751a8b1bb improve fragile tests
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-02-23 08:29:31 +11:00
Greg Wilkins b94d26a720 less fragile tests
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-02-20 10:19:32 +11:00
Greg Wilkins ec51926622 reduce fragility of tests
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-02-19 19:22:32 +11:00
Greg Wilkins ab5fc29cca Jetty 9.4.x 1803 proposal 0 - single ReservedThreadExecutor (#2119)
Issue #1803 - Review usage of scheduling strategies

Use a single ReservedThreadExecutor built into the QueuedThreadPool
via new interface TryExecutor.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-02-08 11:08:48 +01:00
Greg Wilkins f4e37b1adb
Issue #2014 - Unix Socket Client (#2025)
There are still problems with this impl (some client tests ignored) and there is still a work around for the JNR bug 50, however this impl is already much better than the unix socket support that is already in the release.  So will merge for now and put more effort in once there is a JNR fix.

* WIP add unix domain sockets support in HttpClient
* move unix socket client part to unix socket module #2014
* some cleanup #2014
* add missing headers #2014
* add TODO
* UnixSocket client refactor
* cleanup test and pom
* minor changes, use LOG.isDebugEnabled() before using debug method
* add UNIX SOCKET http client test with all other tests, push this to see what happen on Jenkins
* fix some unit tests
* fix more tests
* fix load test
* UnixSocket client
* Demonstrate JNR bug
* Worked around JNR bug 50
* close channel on client side as well
* more details in log
* log file path as well
* #2014 disable test per default as doesn't work on some environement
* Revert "#2014 disable test per default as doesn't work on some environement"
* test only on unix
* Allow test of specific transport(s)
* Move unix socket to /tmp
* move test socket to /tmp
* move test socket to /tmp
* ignore failing tests for now
* fix bean name and possible to use sys prop org.eclipse.jetty.http.client.AbstractTest.Transports with mvn cli
* test isBlank as surefire props is not null
* correctly create tmp file with @Before
* do not delete file
* use /tmp as build directory doesn't seem to work within docker...
* do not delete sock file on client as it is own by the server
* file must not exist when binding unix socket
* #2014 fix license header
* network specific tests assumed
* Fixed to handle null selector keys
* add assume for tests that assume a network connector

Signed-off-by: olivier lamy <olamy@webtide.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-01-13 11:59:47 +01:00
Greg Wilkins de7e3001ef cleanup temp fix for #2046 2018-01-11 17:01:05 +01:00
Greg Wilkins 385ba7d70d Remove graceful handling from ManagedSelector stop #2046
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-01-11 10:29:27 +01:00
Greg Wilkins 7d9f2d7e64 Added info to TimeoutException
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-01-10 21:16:41 +01:00
Greg Wilkins db3891f3d2 removed jmh dependency
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-01-10 17:00:07 +01:00
Greg Wilkins 7138dc3828
Jetty 9.4.x #1918 scalable scheduler3 (#2101)
* Scalable scheduler changes for #1918
* Added HttpChannel.destroy to destroy CyclicTimer
* fixed rebase with HttpConnectionOverFCGI
* renamed to acquire
* Destroying the HttpChannel consistently in all transports.
* updated headers
* cleanup after final review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-01-10 16:56:41 +01:00
Greg Wilkins 356bf2e06f
Issue #2046 - Graceful stop of connections (#2100)
* Clean up of actions (now updates) prior to #2046 fix
* prevent exceptions from termincating lifecycle doStop or destroy
* Refactored ManagedSelector stop to always close endpoints
* Fixed NPE if SelectorManager is already stopped
* refactored after review
* further simplifications after review
* Wait only for oshut endpoints
* Cleanup from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-01-09 20:36:41 +01:00
Joakim Erdfelt 21365234f8 Issue #2108 - Updating license headers for year 2018 2018-01-09 09:44:41 -06:00
Joakim Erdfelt 41ed9f29f4 Merge remote-tracking branch 'origin/jetty-9.3.x' into jetty-9.4.x 2018-01-09 09:37:25 -06:00
Joakim Erdfelt fa4c7b0ca9 Issue #2108 - Updating license headers for year 2018 2018-01-09 08:39:37 -06:00
Joakim Erdfelt 067fc5d2d8 Issue #2108 - Upgrade licenses for 2018 2018-01-09 07:42:06 -06:00
Greg Wilkins 41050cd8a4
Issue #2081 No idle timeout exception when dispatch is delayed (#2083)
Issue #2081 No idle timeout exception when dispatch is delayed
* Delegate the readtimeout handling to HttpChannel so that a delayed dispatch can be ended.
* Added unit test for delayed dispatch idle
* Now using HttpInput.onIdleTimeout() to fail the HttpInput, and then dispatching the request in case it has not been dispatched yet. This ensure consistent behavior independently of the value of HttpConfiguration.delayDispatchUntilContent.
* Fixed for both HTTP/1.1 and HTTP/2.
* Added tests for non-blocking reads.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-01-04 13:26:31 +01:00
Greg Wilkins 54c55b602f
ManagedSelector dump improvements from #1970 (#2062)
* ManagedSelector dump improvements from #1970

ManagedSelector dump improvements from #1970:
 + DumpKeys is now prepended to actions list so it is less likely to be delayed by a stuck/busy selector
 + Timestamps are included for actions and keys which may be separated by time
 + Race removed race for updating dumpKey list while it is being added to.

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

* moved utility timestamp format method to Log

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

* updates after review

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

* changes after review

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

* Issue #1970 - ManagedSelector dump improvements.

Code cleanups.

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

* Revert "Issue #1970 - ManagedSelector dump improvements."

This reverts commit 4febaf10dc.

* Fixed imports and other review feedback

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2018-01-02 11:13:24 +01:00
Simone Bordet e86e8a752c Issue #1973 - Implement minimum response data rate (#2012)
* Code cleanups.

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

* Improved test case handler.

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

* Improved exception message.

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

* Issue #1973 - Implement minimum response data rate.

Implemented response content data rate control in HttpOutput.

Introduced a WriteFlusher.Listener interface that produces events
for every flush(). These events are forwarded to the Connection
and from there to the HttpOutput so that the data rate control can
be enforced.

Both HTTP/1.1 and HTTP/2 are implemented.
Data rate control for HTTP/1.1 is approximate because it will count
also headers bytes and the chunk bytes, while for HTTP/2 is precise.

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

* Issue #1973 - Implement minimum response data rate.

Addressed review comments.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2017-12-27 15:07:32 +01:00
Joakim Erdfelt 2dd970b055 Updating to version 9.2.24-SNAPSHOT 2017-12-18 10:43:47 -06:00
Joakim Erdfelt cdbe733684 Updating to version 9.2.23.v20171218 2017-12-18 09:06:48 -06:00
Simone Bordet 2067eac701 Issue #2003 - Do not submit blocking tasks as managed selector actions.
CreateEndPoint and DestroyEndPoint are now submitted directly to
the Executor, rather than being submitted as selector actions.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2017-12-02 00:28:20 +01:00
Joakim Erdfelt 70fe268bde Merge branch 'release-9.4.8' into jetty-9.4.x 2017-11-29 10:52:02 -07:00
Joakim Erdfelt aeb1a1d6cd Merge tag 'jetty-9.4.8.v20171121' into jetty-9.4.x
Tag for release: jetty-9.4.8-SNAPSHOT

 + 212 HttpClient should support pluggable AuthenticationStore
 + 215 Add Conscrypt for native ALPN/TLS/SSL
 + 272 WebSocket hangs in blockingWrite
 + 487 JDK 9 build compatibility
 + 901 Overriding SSL context KeyStoreType requires explicit override of
   TrustStoreType
 + 922 Implements methods Connection.getBytes[In|Out]()
 + 1209 IllegalStateException when HTTP/2 push is disabled
 + 1213 Upgrade to ASM Version 6.0 for JDK9
 + 1509 Improve GZIPContentDecoder buffer pooling sizing
 + 1550 Resolve inconsistent Shutdown configuration with Jetty Runner
 + 1640 Introduce :run-distro goal for local jetty distribution deployment
 + 1692 Annotation scanning should ignore `module-info.class` files
 + 1696 Missing stacktraces on debug of WriteFlusher onFail
 + 1705 Rejected executions in QueuedThreadPool can lead to memory leaks
 + 1760 Update to apache jasper 8.5.20
 + 1768 Allow jetty properties to be set for the jetty:run-forked goal
 + 1782 Using assembly.tarLongFileMode=posix for jetty-home and
   jetty-distribution assembly
 + 1797 JEP 238 - Multi-Release JAR files break bytecode scanning
 + 1806 Improved ReservedThreads idle timeout
 + 1807 Add new HttpChannel listener and events for metrics libraries
 + 1814 Move JavaVersion to jetty-util for future Java 9 support requirements
 + 1818 Improve Infinispan support on JDK 9
 + 1819 Race condition during annotation parsing
 + 1823 ResourceHandler with ranged requests does not return Content-Type
   response header
 + 1829 OSGi webbundle classes scanned twice
 + 1833 Request.startAsync requires context path
 + 1835 Locker is not reentrant on ServerConnector#setConnectionFactories
 + 1836 Migrate Locker implementation to JVM ReentrantLock implementation
 + 1841 Reduce contention on ServletHolder
 + 1845 Allow null User-Agent in HttpClient
 + 1849 Refactoring of SelectorManager.defaultSchedulers()
 + 1851 Improve insufficient thread warnings/errors
 + 1854 Consistent IOException and timeout handling when extracting form
   parameters
 + 1856 ResourceHandler without ServletContext throws NPE for welcome files if
   used directly
 + 1857 GZIPContentTransformer fails to send entire message if used with
   BufferedContentTransformer
 + 1865 Improve Exception on invalid redirect usage
 + 1867 Improve Exception thrown during Expect 100 Continue
 + 1868 Need a way to randomly select ports for tests
 + 1871 JMXify SslContextFactory
 + 1878 Handle 100 Continue response without Expect header
 + 1879 'Bad tld url' seen during :jetty-run when running integration tests
 + 1881 Improve support of WebSocket over Unix Domain Socket
 + 1885 SessionHandler get/set maxInactiveInterval is not symmetric with
   negative values
 + 1888 Implement cookie matching on Path attribute per RFC 6265
 + 1891 Make HTTP/2 async error notifications configurable
 + 1892 NPE resulting from bad JEP 238 MultiReleaseJarFile structure
 + 1893 Add ability to set HttpClient Connection TTL
 + 1897 Introduce a round-robin connection pool for HttpClient
 + 1900 Update to CDI 2.0 for cdi module
 + 1901 Reimplement PathWatcher as scanner
 + 1909 Update to Apache Jasper 8.5.23
 + 1910 Remove unused jetty-jsp module
 + 1912 AbstractConnector EndPoint leak for failed SSL connections
 + 1914 HttpClient fails to parse Content-Type response header with RFC 2045
   charset="utf-8" syntax
 + 1919 Review LowResourceMonitor
 + 1920 Connect Timeouts with NonBlocking CreateEndPoint
 + 1924 ManagedSelector can livelock under high load
 + 1931 Expose RolloverOutputStream for pluggable behaviour
 + 1933 Use CLASSPATH for scanning java9 system classes
 + 1956 Store and report build information of Jetty
 + 1958 Blocking Timeout has different behavior in HttpInput vs HttpOutput
 + 1970 ManagedSelector can lose selector thread under high concurrent load
 + 1980 PushCacheFilter does not push TLS offloaded HTTP/2 requests
 + 1981 Loading resource content failed
 + 1984 Remove jetty-client dependency in jetty-rewrite
2017-11-29 10:51:22 -07:00
Greg Wilkins 6ac4e770a6 Issue #1983 Warn on connection failures
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2017-11-22 11:08:20 +01:00
Joakim Erdfelt ff53002fac Updating to version 9.4.9-SNAPSHOT 2017-11-21 13:11:31 -07:00
Joakim Erdfelt 82b8fb23f7 Updating to version 9.4.8.v20171121 2017-11-21 12:33:52 -07:00
Simone Bordet 131f46df64 Improved dump of ManagedSelector.
Now also dumping the actions.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2017-11-16 11:35:18 +01:00
Simone Bordet 0f07c6518e
Issue #1970 - ManagedSelector loses selector thread (#1971)
* Issue #1970 - ManagedSelector loses selector thread.

Removed broken data structure ConcurrentStack (ABA problem).

Made ReservedThreadExecutor use a ConcurrentLinkedDeque
instead of ConcurrentStack.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2017-11-14 10:48:33 +01:00
Greg Wilkins 47d46ec60e
Issue #1924 - ManagedSelector livelock. (#1963)
* Issue #1924 - ManagedSelector livelock.

Alternate implementation that is count based rather than time based.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2017-11-14 10:27:04 +01:00
Simone Bordet 761dccd10c Now dumping also SelectionKeys that throw when accessed. 2017-11-08 22:47:16 +01:00
Simone Bordet d1e5883ad4 Issue #1920 - Connect Timeouts with NonBlocking CreateEndPoint.
Made CreateEndPoint and DestroyEndPoint blocking.
2017-11-08 16:28:40 +01:00
Greg Wilkins 6fb7c9ec2e
Issue #1939 fair selector choice (#1937)
* Issue #1939 fair selector choice

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

* Issue #1939 removed address based heuristic for choosing selector

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

* Issue #1939 removed println

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

* Issue #1939 use lambda syntax sugar

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2017-11-04 00:22:45 +11:00
Jesse McConnell a72eb0001d Updating to version 9.3.23-SNAPSHOT 2017-10-30 15:39:57 -05:00