Hi everyone,

I am currently debugging an issue, and I would like to know how an
asynchronous compression action that is currently running in a thread
created through the rolling file manager (
https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java#L326)
reacts to JVM shutdown. I could not find any code that would block until
the action is done during shutdown.

Some background to the problem: I'm creating large log files in a Spark on
Yarn application, and I roll over at a size of 4GB, using gz. When
analyzing the log files, I see that I get log.1.gz, log.2.gz (just like the
pattern I defined) but also log.5 and log.5.gz. The log.5.gz archive is not
readable, so I'm guessing that the compression action could not finish its
work, because the JVM it is running in was shut down by Yarn too early. I
suspected that calling LogManager.shutdown(); would block until all threads
are done, but it does not seem to be the case.

What am I missing here? What needs to be the appropriate setup for having
Log4j2 finish its compression actions before its JVM is shut down? Many
thanks in advance!

Robert

-- 
My GPG Key ID: 336E2680

Reply via email to