Merge branch 'cassandra-2.2' into cassandra-3.0

This commit is contained in:
Jason Brown 2017-08-21 15:33:19 -07:00
commit dc32ed80d7
3 changed files with 15 additions and 1 deletions

View File

@ -20,6 +20,7 @@
* Nodetool listsnapshots output is missing a newline, if there are no snapshots (CASSANDRA-13568)
* sstabledump reports incorrect usage for argument order (CASSANDRA-13532)
Merged from 2.2:
* Uncaught exceptions in Netty pipeline (CASSANDRA-13649)
* Prevent integer overflow on exabyte filesystems (CASSANDRA-13067)
* Fix queries with LIMIT and filtering on clustering columns (CASSANDRA-11223)
* Fix potential NPE when resume bootstrap fails (CASSANDRA-13272)

View File

@ -546,10 +546,14 @@ public abstract class Message
flusher.queued.add(item);
flusher.start();
}
}
@ChannelHandler.Sharable
public static final class ExceptionHandler extends ChannelInboundHandlerAdapter
{
@Override
public void exceptionCaught(final ChannelHandlerContext ctx, Throwable cause)
throws Exception
{
// Provide error message to client in case channel is still open
UnexpectedChannelExceptionHandler handler = new UnexpectedChannelExceptionHandler(ctx.channel(), false);

View File

@ -294,6 +294,7 @@ public class Server implements CassandraDaemon.Server
private static final Frame.Decompressor frameDecompressor = new Frame.Decompressor();
private static final Frame.Compressor frameCompressor = new Frame.Compressor();
private static final Frame.Encoder frameEncoder = new Frame.Encoder();
private static final Message.ExceptionHandler exceptionHandler = new Message.ExceptionHandler();
private static final Message.Dispatcher dispatcher = new Message.Dispatcher();
private static final ConnectionLimitHandler connectionLimitHandler = new ConnectionLimitHandler();
@ -327,6 +328,14 @@ public class Server implements CassandraDaemon.Server
pipeline.addLast("messageDecoder", messageDecoder);
pipeline.addLast("messageEncoder", messageEncoder);
// The exceptionHandler will take care of handling exceptionCaught(...) events while still running
// on the same EventLoop as all previous added handlers in the pipeline. This is important as the used
// eventExecutorGroup may not enforce strict ordering for channel events.
// As the exceptionHandler runs in the EventLoop as the previous handlers we are sure all exceptions are
// correctly handled before the handler itself is removed.
// See https://issues.apache.org/jira/browse/CASSANDRA-13649
pipeline.addLast("exceptionHandler", exceptionHandler);
if (server.eventExecutorGroup != null)
pipeline.addLast(server.eventExecutorGroup, "executor", dispatcher);
else