Commit Graph

796 Commits

Author SHA1 Message Date
Greg Wilkins f6cfe07a69 added direct buffer configuration 2015-02-05 10:02:01 +11:00
Greg Wilkins 55bcd32448 fixed merge 2015-01-08 17:43:55 +01:00
Greg Wilkins e1cc5fb487 Merge remote-tracking branch 'origin/master' into jetty-9.3-ewyk
Conflicts:
	jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java
	jetty-server/src/main/java/org/eclipse/jetty/server/QueuedHttpInput.java
	jetty-util/src/main/java/org/eclipse/jetty/util/thread/NonBlockingThread.java
2015-01-08 15:21:01 +01:00
Joakim Erdfelt a3201a3c81 Happy New Year 2015 2015-01-07 17:06:59 -07:00
Joakim Erdfelt 6a0668b7a1 Happy New Year 2015 2015-01-07 17:03:30 -07:00
Simone Bordet bb3f296626 Fixed byte arithmetic: byte is signed and can't be used as array
index without proper conversion to int.
2015-01-05 16:57:19 +01:00
Greg Wilkins a4d2895400 removed unneeded execute for SslConnection onFillable 2015-01-02 15:24:14 +01:00
Greg Wilkins 39b478e2c4 Speculative fix for EWYK SSL client 2015-01-02 14:33:25 +01:00
Greg Wilkins beacb948b1 Allow configuration of ExecutionStrategy
eg -Dorg.eclipse.jetty.io.ManagedSelector.ExecutionStrategy=org.eclipse.jetty.util.thread.ExecutionStrategy$ExecuteProduceRun
2015-01-01 17:04:00 +01:00
Greg Wilkins 3af9b145a3 Deprecated the AbstractConnection dispatchIO mechanism 2015-01-01 16:18:13 +01:00
Greg Wilkins 191286970a Use remote IP to distribute connections over selectors 2014-12-28 01:05:56 +01:00
Greg Wilkins ee3481cb3f fixed ByteArrayEndPoint dispatch 2014-12-24 12:50:19 +01:00
Greg Wilkins fecc03a2f5 fixed some more tests after EWYK refactor 2014-12-23 22:20:49 +01:00
Greg Wilkins 3f59bc4c14 refactored HttpConnector for EWYK - work in progress 2014-12-23 17:15:27 +01:00
Simone Bordet 023c593d35 Removed loop calling the ExecutionStrategy, since it was spinning.
In case of ProduceExecuteRun, the producer is called in a loop, and
it never returns null (unless stopped), so ExecutionStrategy.execute()
never returns.

In case of ExecuteProduceRun, ExecutionStrategy.execute() does return,
but only after it has arranged another thread to continue producing.
Therefore calling ExecutionStrategy.execute() in a loop was spinning
since the ExecutionStrategy had already arranged to produce with
another thread and therefore calling execute() again was a
no-operation hence causing the spinning.
2014-12-23 17:01:10 +01:00
Simone Bordet 9cff4a57e7 Merged branch 'master' into 'jetty-9.3-ewyk'. 2014-12-22 21:34:10 +01:00
Simone Bordet e8c88cfd9c Merged branch 'jetty-9.2.x' into 'master'. 2014-12-22 21:32:09 +01:00
Greg Wilkins 2a584613ee work in progress on EWYK HTTP 2014-12-21 20:56:36 +01:00
Greg Wilkins b0b038f5b0 fillInterest never recurses 2014-12-19 23:03:01 +01:00
Simone Bordet 448f150ac4 Cleaned up ExecutionStrategy by adding javadocs, removing methods not
used and renaming classes and methods to better names.
2014-12-19 11:25:09 +01:00
Simone Bordet 393bfa76f0 Code cleanups. 2014-12-19 10:15:14 +01:00
Greg Wilkins 3b34423b17 EWYK SelectorManager 2014-12-18 17:06:32 +01:00
Greg Wilkins 31e06b5791 refactored jetty-io to not have onFillable statemachine. work in progres... 2014-12-18 14:10:06 +01:00
Greg Wilkins 97af3632a1 SelectManager executes endpoint tasks 2014-12-17 17:03:15 +01:00
Greg Wilkins bbd2ba60e7 fixed refactor file header 2014-12-17 16:36:46 +01:00
Greg Wilkins cdd2b0a9d2 refacted SelectorManager to have a ManagedSelector 2014-12-17 16:29:24 +01:00
Joakim Erdfelt 2b241ac04b 454773 - SSLConnection use on Android client results in loop
+ Adding safety check for SSL unwrap in client mode that
  results in OK status but no content
2014-12-12 09:24:39 -07:00
Greg Wilkins d161bdcb36 Merge remote-tracking branch 'origin/jetty-9.2.x'
Conflicts:
	VERSION.txt
	aggregates/jetty-all/pom.xml
	apache-jsp/pom.xml
	apache-jstl/pom.xml
	examples/async-rest/async-rest-jar/pom.xml
	examples/async-rest/async-rest-webapp/pom.xml
	examples/async-rest/pom.xml
	examples/embedded/pom.xml
	examples/pom.xml
	jetty-alpn/jetty-alpn-client/pom.xml
	jetty-alpn/jetty-alpn-server/pom.xml
	jetty-alpn/pom.xml
	jetty-annotations/pom.xml
	jetty-ant/pom.xml
	jetty-cdi/pom.xml
	jetty-client/pom.xml
	jetty-continuation/pom.xml
	jetty-deploy/pom.xml
	jetty-distribution/pom.xml
	jetty-fcgi/fcgi-client/pom.xml
	jetty-fcgi/fcgi-server/pom.xml
	jetty-fcgi/pom.xml
	jetty-http-spi/pom.xml
	jetty-http/pom.xml
	jetty-io/pom.xml
	jetty-jaas/pom.xml
	jetty-jaspi/pom.xml
	jetty-jmx/pom.xml
	jetty-jndi/pom.xml
	jetty-jsp/pom.xml
	jetty-jspc-maven-plugin/pom.xml
	jetty-maven-plugin/pom.xml
	jetty-monitor/pom.xml
	jetty-nosql/pom.xml
	jetty-osgi/jetty-osgi-alpn/pom.xml
	jetty-osgi/jetty-osgi-boot-jsp/pom.xml
	jetty-osgi/jetty-osgi-boot-warurl/pom.xml
	jetty-osgi/jetty-osgi-boot/pom.xml
	jetty-osgi/jetty-osgi-httpservice/pom.xml
	jetty-osgi/jetty-osgi-npn/pom.xml
	jetty-osgi/pom.xml
	jetty-osgi/test-jetty-osgi-context/pom.xml
	jetty-osgi/test-jetty-osgi-webapp/pom.xml
	jetty-osgi/test-jetty-osgi/pom.xml
	jetty-plus/pom.xml
	jetty-proxy/pom.xml
	jetty-quickstart/pom.xml
	jetty-rewrite/pom.xml
	jetty-runner/pom.xml
	jetty-security/pom.xml
	jetty-server/pom.xml
	jetty-servlet/pom.xml
	jetty-servlets/pom.xml
	jetty-spdy/pom.xml
	jetty-spdy/spdy-alpn-tests/pom.xml
	jetty-spdy/spdy-client/pom.xml
	jetty-spdy/spdy-core/pom.xml
	jetty-spdy/spdy-example-webapp/pom.xml
	jetty-spdy/spdy-http-client-transport/pom.xml
	jetty-spdy/spdy-http-common/pom.xml
	jetty-spdy/spdy-http-server/pom.xml
	jetty-spdy/spdy-npn-tests/pom.xml
	jetty-spdy/spdy-server/pom.xml
	jetty-spring/pom.xml
	jetty-start/pom.xml
	jetty-util-ajax/pom.xml
	jetty-util/pom.xml
	jetty-webapp/pom.xml
	jetty-websocket/javax-websocket-client-impl/pom.xml
	jetty-websocket/javax-websocket-server-impl/pom.xml
	jetty-websocket/pom.xml
	jetty-websocket/websocket-api/pom.xml
	jetty-websocket/websocket-client/pom.xml
	jetty-websocket/websocket-common/pom.xml
	jetty-websocket/websocket-server/pom.xml
	jetty-websocket/websocket-servlet/pom.xml
	jetty-xml/pom.xml
	pom.xml
	tests/pom.xml
	tests/test-continuation/pom.xml
	tests/test-integration/pom.xml
	tests/test-loginservice/pom.xml
	tests/test-quickstart/pom.xml
	tests/test-sessions/pom.xml
	tests/test-sessions/test-hash-sessions/pom.xml
	tests/test-sessions/test-jdbc-sessions/pom.xml
	tests/test-sessions/test-mongodb-sessions/pom.xml
	tests/test-sessions/test-sessions-common/pom.xml
	tests/test-webapps/pom.xml
	tests/test-webapps/test-jaas-webapp/pom.xml
	tests/test-webapps/test-jetty-webapp/pom.xml
	tests/test-webapps/test-jndi-webapp/pom.xml
	tests/test-webapps/test-mock-resources/pom.xml
	tests/test-webapps/test-proxy-webapp/pom.xml
	tests/test-webapps/test-servlet-spec/pom.xml
	tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml
	tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
	tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
	tests/test-webapps/test-webapp-rfc2616/pom.xml
2014-12-11 13:50:21 +01:00
Simone Bordet cce5c14e7c Fixed typos. 2014-12-05 14:01:05 +01:00
Greg Wilkins 07e87f0ecf 454157 abort to avoid spin in async HttpInput.consumeAll 2014-12-04 17:39:53 +01:00
Greg Wilkins 981e27b383 452246 Fixed SSL hang on last chunk
Back ported refinements from 9.3 to handle empty arrays
2014-11-27 18:23:21 +11:00
Greg Wilkins 30776f9662 fixed merge 2014-11-27 14:32:09 +11:00
Greg Wilkins 1159111c52 Merge remote-tracking branch 'origin/jetty-9.2.x'
Conflicts:
	jetty-io/src/main/java/org/eclipse/jetty/io/SelectChannelEndPoint.java
	jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java
2014-11-27 13:34:45 +11:00
Greg Wilkins a39dcd6fe5 452246 Fixed SSL hang on last chunk
Fixed WriteFlusher to distinguish between a flush that consumes all content and returns false, from one
that consumes all content and returns true.
If false is returned, the flusher needs to remain in pending so encrypted buffers can be flushed.
2014-11-27 11:45:08 +11:00
Greg Wilkins 5da7c29787 Simplified SelectorManager state machine
Removed changing state, as it is just an aspect of processing.
2014-10-22 10:29:41 +11:00
Greg Wilkins a906aaa266 Simplified SelectorManager state machine
Made the SelectorManager use the CaS state machine for both locking and controlling
the mode of handling changes.

Replaced the concurrent change queue with a pair of array lists that are switched while the lock state is held
2014-10-17 14:16:48 +11:00
Greg Wilkins e8a843dc6a Submit selector interest changes
After seeing a stack trace with many threads blocked on setInterest, have reverted to always submitting changes
2014-10-17 12:36:02 +11:00
Simone Bordet 61ec3efd65 Cosmetics. 2014-10-15 11:39:32 +02:00
Greg Wilkins d82809d2f1 Simplified state machine for select interest update.
The state machine now simply tracks if the endpoint is selecting or has been selected.
The slight complexity is that any transition between these two states goes via a locked
state, where there is exclusive access to the interested ops and selection key.
2014-10-15 17:33:58 +11:00
Simone Bordet 395ecd2b70 Fixed race in updating the key interests.
It was possible that updateKey() was seeing a SELECTING state and
therefore attempt to call setKeyInterests(), while changeInterests()
was also seeing the SELECTING state, then moving to CHANGING so that
_interestOps was accessed concurrently.

Also made the update task to call updateKey() instead of calling
directly setKeyInterests(), in order to comply with the state
machine; this required to have onSelected() handle additional states
that are created by updateKey().

Finally, in updateKey() now setKeyInterests() is called before
updating the state to isolate the call into its own state.
2014-10-14 20:40:13 +02:00
Simone Bordet e7d830c26e Merged branch 'jetty-9.2.x' into 'master'. 2014-10-13 16:57:52 +02:00
Simone Bordet abdd2e4ff0 440729 - SSL requests often fail with EOFException or IllegalStateException.
Fixed IllegalStateException by handling NEED_UNWRAP for the CLOSED
state in fill().
The EOFException does not seem to be an issue with the client.

Also removed an unneeded catch block and an empty if statement.
2014-10-13 16:55:59 +02:00
Simone Bordet 96cf942b70 Fixed race condition in onSelected().
WebSocket and multiplexed protocols are always read interested.
It may happen that while the application is writing, the write
blocks, resulting in a call to changeInterests().
At the same time, the selector may detect data to read and call
onSelected(), so there is a possibility that onSelected() runs
concurrently with changeInterests().

The fix adds an additional state (PROCESSING) that isolates the
changes that onSelected() makes to _interestOps, spin-waiting if
changeInterests() is running concurrently.
Likewise, changeInterests() spin-waits until onSelected() is running
concurrently.
2014-10-09 22:46:04 +02:00
Simone Bordet 76278d3563 Fixed race condition causing onSelected() to throw IllegalStateException.
The race was happening when updateKey() lost the race with
changeInterests() to update the interests and subsequently the key.
In that case, the selector thread that called updateKey() was returning
while changeInterests() was executing the CHANGING state.
Since updateKey() lost the race, the actual key interests was still
(typically) OP_READ so the selector thread would select() and call
onSelected() while changeInterests() was still executing, causing the
IllegalStateException.
2014-10-09 16:43:50 +02:00
Simone Bordet 649eb7f3dc Introduced factory method to create JDK's Selector instances. 2014-10-09 10:08:15 +02:00
Simone Bordet bcbefd3942 Fixed race where the key interests were set before updating the
state, causing onSelected() to be called with the wrong state and
failing an assertion.
2014-09-26 10:13:16 +02:00
Simone Bordet 8d2efaf7eb 445167 - Allow configuration of dispatch after select.
Introduced parameter "dispatchIO" in the relevant factories so that
they can be configured by users and connections will be created
taking into account this parameter.

For less configurable connection factories, this parameter is
currently hardcoded to either true or false depending on the case.
For example, ALPN and NPN connections have it to false, since they
don't do any blocking operation in onFillable().
2014-09-26 10:13:16 +02:00
Greg Wilkins 2018098225 Merge remote-tracking branch 'origin/jetty-9.2.x'
Conflicts:
	jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java
2014-09-18 16:36:51 +10:00
Greg Wilkins 3b066ca2ae 444415 iterative WriteFlusher 2014-09-18 15:31:59 +10:00
Simone Bordet 193eaaf1c3 SelectChannelEndPoint should set the interestOps as requested.
Previously, SCEP was skipping the update of the interestOps in case it
was either input or output shutdown.

Now it always set the interestOps as requested and leaves to the
connection decide what interestOps needs to be set.
2014-09-17 17:44:49 +02:00