cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Podkowinski (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-13368) Exception Stack not Printed as Intended in Error Logs
Date Fri, 24 Mar 2017 13:47:41 GMT


Stefan Podkowinski commented on CASSANDRA-13368:

If you add something like {{logger.error("ERROR {}", "TEST", new RuntimeException());}} to
CassandraDaemon.setup() and start Cassandra, you should notice that the stacktrace is printed
just fine.
Are you using the logback.xml from the vanilla Apache debian package?

> Exception Stack not Printed as Intended in Error Logs
> -----------------------------------------------------
>                 Key: CASSANDRA-13368
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: William R. Speirs
>            Priority: Trivial
>              Labels: lhf
>             Fix For: 2.1.x
>         Attachments: cassandra-13368-2.1.patch
> 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 {{}}:
> {noformat}
>         catch (Exception e)
>         {
>             JVMStabilityInspector.inspectThrowable(e);
>             logger.error("error registering MBean {}", MBEAN_NAME, e);
>             //Allow the server to start even if the bean can't be registered
>         }
> {noformat}
> 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:
> {noformat}
> db/            logger.error("error registering MBean {}",
> 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(), e);
> service/                logger.error("Exception in thread {}",
t, e);
> service/                logger.error("error registering MBean
{}", MBEAN_NAME, e);
> streaming/            logger.error("[Stream #{}] Streaming error
occurred", planId(), e);
> transport/                logger.error("Problem retrieving RPC address
for {}", endpoint, e);
> {noformat}
> And one where it'll print the {{toString()}} version of the exception:
> {noformat}
> db/            logger.error("Could not calculate the size of {}.
{}", input, e);
> {noformat}
> 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