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
|