From pr-return-1613-archive-asf-public=cust-asf.ponee.io@cassandra.apache.org Thu Nov 29 15:33:31 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C94F818066C for ; Thu, 29 Nov 2018 15:33:30 +0100 (CET) Received: (qmail 31996 invoked by uid 500); 29 Nov 2018 14:33:29 -0000 Mailing-List: contact pr-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: pr@cassandra.apache.org Delivered-To: mailing list pr@cassandra.apache.org Received: (qmail 31979 invoked by uid 99); 29 Nov 2018 14:33:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2018 14:33:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2FE0FE10CA; Thu, 29 Nov 2018 14:33:29 +0000 (UTC) From: jasobrown To: pr@cassandra.apache.org Reply-To: pr@cassandra.apache.org References: In-Reply-To: Subject: [GitHub] cassandra pull request #294: Fixing logging of netty client related ioexcept... Content-Type: text/plain Message-Id: <20181129143329.2FE0FE10CA@git1-us-west.apache.org> Date: Thu, 29 Nov 2018 14:33:29 +0000 (UTC) Github user jasobrown commented on a diff in the pull request: https://github.com/apache/cassandra/pull/294#discussion_r237509397 --- Diff: src/java/org/apache/cassandra/transport/Message.java --- @@ -710,7 +710,7 @@ public boolean apply(Throwable exception) boolean isIOException = exception instanceof IOException || (exception.getCause() instanceof IOException); if (!alwaysLogAtError && isIOException) { - if (ioExceptionsAtDebugLevel.contains(exception.getMessage())) + if (ioExceptionsAtDebugLevel.stream().anyMatch(ioExceptionAtDebugLevel -> exception.getMessage().contains(ioExceptionAtDebugLevel))) --- End diff -- I'd prefer to avoid the streaming API as it creates a bunch of excess garbage. How about something like this instead: ```java // exceptions thrown from the netty epoll transport add the name of the function that failed // to the exception string (which is simply wrapping a JDK exception), so we can't do a simple/naive comparison String errorMessage = exception.getMessage(); boolean logAtTrace = false; for (String s : ioExceptionsAtDebugLevel) { if (errorMessage.contains(s)) { logAtTrace = true; break; } } if (logAtTrace) { // Likely unclean client disconnects logger.trace(message, exception); } else { // Generally unhandled IO exceptions are network issues, not actual ERRORS logger.info(message, exception); } ``` --- --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org For additional commands, e-mail: pr-help@cassandra.apache.org