aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2013-06-21 09:28:33 (EDT)
committerThomas Becker2013-06-21 09:28:33 (EDT)
commit4ba9385ebc744ae1de55d650e3a983c2058d93bb (patch)
tree1d3ad8935f10d3f3ad3afb01ef129b12861862db
parent918632d40851ca939ba0ec502e2cd95a54f1dd1e (diff)
downloadorg.eclipse.jetty.project-4ba9385ebc744ae1de55d650e3a983c2058d93bb.zip
org.eclipse.jetty.project-4ba9385ebc744ae1de55d650e3a983c2058d93bb.tar.gz
org.eclipse.jetty.project-4ba9385ebc744ae1de55d650e3a983c2058d93bb.tar.bz2
411340 add comment why executeOnFillable defaults to true
-rw-r--r--jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java b/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java
index b057b8a..b77b9d6 100644
--- a/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java
+++ b/jetty-spdy/spdy-client/src/main/java/org/eclipse/jetty/spdy/client/SPDYConnection.java
@@ -53,11 +53,16 @@ public class SPDYConnection extends AbstractConnection implements Controller, Id
public SPDYConnection(EndPoint endPoint, ByteBufferPool bufferPool, Parser parser, Executor executor,
boolean executeOnFillable, int bufferSize)
{
- // Since SPDY is multiplexed, onFillable() must never block
- // while calling application code. In fact, onFillable()
- // always dispatches to a new thread when calling application
- // code, so here we can safely pass false as last parameter,
- // and avoid to dispatch to onFillable().
+ // Since SPDY is multiplexed, onFillable() must never block while calling application code. In fact,
+ // the SPDY code always dispatches to a new thread when calling application code,
+ // so here we can safely pass false as last parameter, and avoid to dispatch to onFillable(). The IO
+ // operation (read, parse, etc.) will not block and will be fast in almost all cases. Big uploads to a server
+ // however might block the Selector thread for a long time and therefore block other connections to be read.
+ // This might be a good reason to set executeOnFillable to true.
+ //
+ // Due to a jvm bug we've had a Selector thread being stuck at
+ // sun.nio.ch.FileDispatcherImpl.preClose0(Native Method). That's why we now default executeOnFillable to
+ // true even if for most use cases it is faster to not dispatch the IO events.
super(endPoint, executor, executeOnFillable);
this.bufferPool = bufferPool;
this.parser = parser;