Merged branch 'jetty-9.4.x' into 'master'.

This commit is contained in:
Simone Bordet 2016-12-20 11:55:39 +01:00
commit b5d2b73f07
5 changed files with 413 additions and 376 deletions

View File

@ -18,18 +18,18 @@
=== What Version Do I Use?
Jetty 9 is the most recent version of Jetty and has a great many improvements over previous versions.
One improvement is this documentation which focuses on Jetty 9.
This documentation which focuses on Jetty 9.
While many people continue to use older versions of Jetty, we generally recommend using Jetty 9 as it represents the version of Jetty that we will actively maintain and improve over the next few years.
.Jetty Versions
[width="100%",cols="12%,9%,15%,6%,21%,10%,6%,21%",options="header",]
|=======================================================================
|Version |Year |Home |JVM |Protocols |Servlet |JSP |Status
|9.4 |2016 |Eclipse |1.8 |HTTP/1.1 (RFC 7230), HTTP/2 (RFC 7540), WebSocket (RFC 6455, JSR 356), FastCGI |3.1 |2.3 |Stable
|9.3 |2015 |Eclipse |1.8 |HTTP/1.1 (RFC 7230), HTTP/2 (RFC 7540), WebSocket (RFC 6455, JSR 356), FastCGI |3.1 |2.3 |Stable
|9.2 |2014 |Eclipse |1.7 |HTTP/1.1 RFC2616, javax.websocket, SPDY v3 |3.1 |2.3 |Stable
|8.2 |2009- |Eclipse/Codehaus |1.7 |HTTP/1.1 RFC2616, WebSocket RFC 6455, SPDY v3 |3.0 |2.2 |Venerable
|8.1 |2009- |Eclipse/Codehaus |1.6 |HTTP/1.1 RFC2616, WebSocket RFC 6455, SPDY v3 |3.0 |2.2 |Venerable
|7 |2008- |Eclipse/Codehaus |1.5 |HTTP/1.1 RFC2616, WebSocket RFC 6455, SPDY v3 |2.5 |2.1 |Venerable
|8 |2009-2014 |Eclipse/Codehaus |1.6 |HTTP/1.1 RFC2616, WebSocket RFC 6455, SPDY v3 |3.0 |2.2 |Deprecated
|7 |2008-2014 |Eclipse/Codehaus |1.5 |HTTP/1.1 RFC2616, WebSocket RFC 6455, SPDY v3 |2.5 |2.1 |Deprecated
|6 |2006-2010 |Codehaus |1.4-1.5 |HTTP/1.1 RFC2616 |2.5 |2.0 |Deprecated
|5 |2003-2009 |Sourceforge |1.2-1.5 |HTTP/1.1 RFC2616 |2.4 |2.0 |Deprecated
|4 |2001-2006 |Sourceforge |1.2, J2ME |HTTP/1.1 RFC2616 |2.3 |1.2 |Ancient

View File

@ -24,3 +24,4 @@ include::troubleshooting-locked-files.adoc[]
include::preventing-memory-leaks.adoc[]
include::slow-deployment.adoc[]
include::security-reports.adoc[]
include::watchservice.adoc[]

View File

@ -0,0 +1,35 @@
// ========================================================================
// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
// ========================================================================
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
[[watchservice]]
=== Java WatchService
The JVM link:https://docs.oracle.com/javase/7/docs/api/java/nio/file/WatchService.html[`WatchService`] is in place to monitor objects like a directory for changes, and then update it's contents and notify the application of those changes.
This service is useful for features like link:#hot-deployment[Hot Deployment].
When a change is detected, the `WatchService` will enter a "quiet time" where it is waiting for the change (or changes) to be made and completed before notifying the application of the change.
Example:
A new war file is copied into `/webapps`.
The `WatchService` can (depending on implementation) see that the file was created (which is registered as an event!, and that its growing in size (another event).
With the quiet time, each of the events are gated behind that timeout before the aggregated events are sent to the application.
While some operating systems such as Windows have a native value for this quiet time, not all do, notably OSX.
At the core this is a limitation of the JVM's FileSystem-specific implementation, but one that has been raised to the link:https://bugs.openjdk.java.net/browse/JDK-7133447[attention of the project.]
==== Remedy
To help offset the delay in systems like OSX, Jetty defaults the value for non-native implementations to a link:{GITBROWSEURL}/jetty-util/src/main/java/org/eclipse/jetty/util/PathWatcher.java#L1431[time of 5000ms.]
Using values lower than 5000ms is not recommended and has shown to frequently fail.

View File

@ -93,7 +93,6 @@ public class SslConnection extends AbstractConnection
private boolean _renegotiationAllowed;
private boolean _closedOutbound;
private abstract class RunnableTask implements Runnable, Invocable
{
private final String _operation;
@ -140,7 +139,7 @@ public class SslConnection extends AbstractConnection
}
};
Callback _sslReadCallback = new Callback()
private final Callback _sslReadCallback = new Callback()
{
@Override
public void succeeded()
@ -353,31 +352,27 @@ public class SslConnection extends AbstractConnection
// This means that a write of data has failed. Writes are done
// only if there is an active writeflusher or a read needed to write
// data. In either case the appropriate callback is passed on.
boolean fail_filler = false;
boolean fail_filler;
synchronized (DecryptedEndPoint.this)
{
if (LOG.isDebugEnabled())
LOG.debug("{} write.failed", SslConnection.this, x);
LOG.debug("{} write failed", SslConnection.this, x);
BufferUtil.clear(_encryptedOutput);
releaseEncryptedOutputBuffer();
_cannotAcceptMoreAppDataToFlush = false;
fail_filler = _fillRequiresFlushToProgress;
if (_fillRequiresFlushToProgress)
{
_fillRequiresFlushToProgress = false;
fail_filler = true;
}
}
final boolean filler_failed=fail_filler;
failedCallback(new Callback()
{
@Override
public void failed(Throwable x)
{
if (filler_failed)
if (fail_filler)
getFillInterest().onFail(x);
getWriteFlusher().onFail(x);
}
@ -507,7 +502,6 @@ public class SslConnection extends AbstractConnection
getExecutor().execute(_runCompleteWrite);
}
}
}
@Override
@ -579,7 +573,11 @@ public class SslConnection extends AbstractConnection
}
@Override
public synchronized int fill(ByteBuffer buffer) throws IOException
public int fill(ByteBuffer buffer) throws IOException
{
try
{
synchronized (this)
{
try
{
@ -772,7 +770,6 @@ public class SslConnection extends AbstractConnection
catch (SSLHandshakeException x)
{
notifyHandshakeFailed(_sslEngine, x);
close(x);
throw x;
}
catch (SSLException x)
@ -782,12 +779,6 @@ public class SslConnection extends AbstractConnection
x = (SSLException)new SSLHandshakeException(x.getMessage()).initCause(x);
notifyHandshakeFailed(_sslEngine, x);
}
close(x);
throw x;
}
catch (Throwable x)
{
close(x);
throw x;
}
finally
@ -811,6 +802,13 @@ public class SslConnection extends AbstractConnection
}
}
}
}
catch (Throwable x)
{
close(x);
throw x;
}
}
private void closeInbound()
{
@ -825,7 +823,7 @@ public class SslConnection extends AbstractConnection
}
@Override
public synchronized boolean flush(ByteBuffer... appOuts) throws IOException
public boolean flush(ByteBuffer... appOuts) throws IOException
{
// The contract for flush does not require that all appOuts bytes are written
// or even that any appOut bytes are written! If the connection is write block
@ -840,6 +838,10 @@ public class SslConnection extends AbstractConnection
LOG.debug("{} flush {}", SslConnection.this, BufferUtil.toHexSummary(b));
}
try
{
synchronized (this)
{
try
{
if (_cannotAcceptMoreAppDataToFlush)
@ -983,12 +985,6 @@ public class SslConnection extends AbstractConnection
catch (SSLHandshakeException x)
{
notifyHandshakeFailed(_sslEngine, x);
close(x);
throw x;
}
catch (Throwable x)
{
close(x);
throw x;
}
finally
@ -996,6 +992,13 @@ public class SslConnection extends AbstractConnection
releaseEncryptedOutputBuffer();
}
}
}
catch (Throwable x)
{
close(x);
throw x;
}
}
private void releaseEncryptedOutputBuffer()
{
@ -1035,7 +1038,6 @@ public class SslConnection extends AbstractConnection
// TODO review close logic here
if (ishut)
close = true;
}
if (flush)
@ -1128,5 +1130,4 @@ public class SslConnection extends AbstractConnection
return super.toString()+"->"+getEndPoint().toString();
}
}
}

View File

@ -8,7 +8,7 @@ logback
[depend]
server
logback-core
logback-impl
resources
[provide]