[
https://issues.apache.org/jira/browse/CASSANDRA-10447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14945348#comment-14945348
]
Ariel Weisberg commented on CASSANDRA-10447:
--------------------------------------------
Oh thanks Paulo, I didn't have the source for logbook classic loaded so I
didn't see that LoggerContext overrides stop(). I was very confused.
It's easy to reproduce. On trunk run "ant test -Dtest.name=RoleOptionsTest" and
then look at the log file in build/test/logs. For me the log file is empty.
It definitely happens in the test config and it's very obvious. Whether it
happens in the production config is harder to suss out since the production
config doesn't buffer heavily like the test config and drains as fast as it
can. My suspicion is that it should have the same issue not stopping appenders.
If you are free you are welcome to look at it. I am doing two code reviews, but
I should be able to get to both for 3.0.0rc2.
> Async logging configuration doesn't result in data flushing when shutdown
> hook runs
> -----------------------------------------------------------------------------------
>
> Key: CASSANDRA-10447
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10447
> Project: Cassandra
> Issue Type: Bug
> Reporter: Ariel Weisberg
> Assignee: Ariel Weisberg
> Fix For: 3.0.0 rc2
>
>
> Stefania discovered that tests that don't produce a lot of log output end up
> producing 0 debug output to files because the data is not flushed as part of
> the shutdown hook. I traced through and it looks like the shutdown hook
> doesn't actually invoke code that does anything useful. It shuts down an
> executor service in the logging context but doesn't call stop on any
> appenders.
> A hackish thing we can do is use a status listener to collect all the
> appenders and then stop them when the shutdown hook runs. Even adding a small
> delay to the shutdown hook (no code changes on our part) would in let the
> async appender flush in 90% of cases.
> We still need to fix it for test which uses a different config file and for
> which a small delay is not desirable.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)