cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William R. Speirs (JIRA)" <>
Subject [jira] [Created] (CASSANDRA-13368) Exception Stack not Printed as Intended in Error Logs
Date Wed, 22 Mar 2017 18:24:41 GMT
William R. Speirs created CASSANDRA-13368:

             Summary: Exception Stack not Printed as Intended in Error Logs
                 Key: CASSANDRA-13368
             Project: Cassandra
          Issue Type: Bug
            Reporter: William R. Speirs
            Priority: Trivial

There are a number of instances where it appears the programmer intended to print a stack
trace in an error message, but it is not actually being printed. For example, in {{}}:

        catch (Exception e)
            logger.error("error registering MBean {}", MBEAN_NAME, e);
            //Allow the server to start even if the bean can't be registered

The logger will use the second argument for the braces, but will ignore the exception {{e}}.
It would be helpful to have the stack traces of these exceptions printed. I propose adding
a second line that prints the full stack trace: {{logger.error(e.getMessage(), e);}}

On the 2.1 branch, I found 8 instances of these types of messages:

db/            logger.error("error registering MBean {}", MBEAN_NAME,
io/sstable/            logger.error("Corrupt sstable {}; skipped",
descriptor, e);
net/                    logger.error("error processing a message
intended for {}", poolReference.endPoint(), e);
net/                logger.error("error writing to {}", poolReference.endPoint(),
service/                logger.error("Exception in thread {}", t,
service/                logger.error("error registering MBean {}",
streaming/            logger.error("[Stream #{}] Streaming error occurred",
planId(), e);
transport/                logger.error("Problem retrieving RPC address for
{}", endpoint, e);

And one where it'll print the {{toString()}} version of the exception:

db/            logger.error("Could not calculate the size of {}. {}",
input, e);

I'm happy to create a patch for each branch, just need a little guidance on how to do so.
We're currently running 2.1 so I started there.

This message was sent by Atlassian JIRA

View raw message