You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2021/10/20 16:02:11 UTC
[cassandra] branch trunk updated (b1c3755 -> fafd88e)
This is an automated email from the ASF dual-hosted git repository.
brandonwilliams pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.
from b1c3755 Merge branch 'cassandra-4.0' into trunk
new f71dfdc Push connection reset by peer messages to trace
new 20abdfc Merge branch 'cassandra-3.0' into cassandra-3.11
new 4e77cc8 Merge branch 'cassandra-3.11' into cassandra-4.0
new fafd88e Merge branch 'cassandra-4.0' into trunk
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/java/org/apache/cassandra/transport/ExceptionHandlers.java | 6 ++++++
1 file changed, 6 insertions(+)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org
[cassandra] 01/01: Merge branch 'cassandra-4.0' into trunk
Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
brandonwilliams pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git
commit fafd88e717eec071559c3b141cde8eb9801a4234
Merge: b1c3755 4e77cc8
Author: Brandon Williams <br...@apache.org>
AuthorDate: Wed Oct 20 11:01:22 2021 -0500
Merge branch 'cassandra-4.0' into trunk
src/java/org/apache/cassandra/transport/ExceptionHandlers.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --cc src/java/org/apache/cassandra/transport/ExceptionHandlers.java
index 377b640,1c5c976..e2c570d
--- a/src/java/org/apache/cassandra/transport/ExceptionHandlers.java
+++ b/src/java/org/apache/cassandra/transport/ExceptionHandlers.java
@@@ -34,8 -32,7 +34,9 @@@ import io.netty.channel.Channel
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelPromise;
+ import io.netty.channel.unix.Errors;
+import org.apache.cassandra.exceptions.OverloadedException;
+import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.metrics.ClientMetrics;
import org.apache.cassandra.net.FrameEncoder;
import org.apache.cassandra.transport.messages.ErrorMessage;
@@@ -110,44 -118,6 +111,49 @@@ public class ExceptionHandler
}
}
+ static void logClientNetworkingExceptions(Throwable cause)
+ {
+ if (Throwables.anyCauseMatches(cause, t -> t instanceof ProtocolException))
+ {
+ // if any ProtocolExceptions is not silent, then handle
+ if (Throwables.anyCauseMatches(cause, t -> t instanceof ProtocolException && !((ProtocolException) t).isSilent()))
+ {
+ ClientMetrics.instance.markProtocolException();
+ // since protocol exceptions are expected to be client issues, not logging stack trace
+ // to avoid spamming the logs once a bad client shows up
+ NoSpamLogger.log(logger, NoSpamLogger.Level.WARN, 1, TimeUnit.MINUTES, "Protocol exception with client networking: " + cause.getMessage());
+ }
+ }
+ else if (Throwables.anyCauseMatches(cause, t -> t instanceof OverloadedException))
+ {
+ // Once the threshold for overload is breached, it will very likely spam the logs...
+ NoSpamLogger.log(logger, NoSpamLogger.Level.INFO, 1, TimeUnit.MINUTES, cause.getMessage());
+ }
++ else if (Throwables.anyCauseMatches(cause, t -> t instanceof Errors.NativeIoException))
++ {
++ ClientMetrics.instance.markUnknownException();
++ logger.trace("Native exception in client networking", cause);
++ }
+ else
+ {
+ ClientMetrics.instance.markUnknownException();
+ logger.warn("Unknown exception in client networking", cause);
+ }
+ }
+
+ static Predicate<Throwable> getUnexpectedExceptionHandler(Channel channel, boolean alwaysLogAtError)
+ {
+ SocketAddress address = channel.remoteAddress();
+ if (DatabaseDescriptor.getClientErrorReportingExclusions().contains(address))
+ {
+ return cause -> {
+ logger.debug("Excluding client exception for {}; address contained in client_error_reporting_exclusions", address, cause);
+ return true;
+ };
+ }
+ return new UnexpectedChannelExceptionHandler(channel, alwaysLogAtError);
+ }
+
/**
* Include the channel info in the logged information for unexpected errors, and (if {@link #alwaysLogAtError} is
* false then choose the log level based on the type of exception (some are clearly client issues and shouldn't be
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org