Miklos Szurap created HIVE-28733:
------------------------------------
Summary: Sometimes hive logs are not rolled / deleted
Key: HIVE-28733
URL: https://issues.apache.org/jira/browse/HIVE-28733
Project: Hive
Issue Type: Bug
Reporter: Miklos Szurap
Using the log4j delete plugin:
{code}
property.max.log.file.backup.index=10
appender.DRFA.type=RollingRandomAccessFile
appender.DRFA.name=DRFA
appender.DRFA.fileName=${log.dir}/${log.file}
appender.DRFA.filePattern=${log.dir}/${log.file}.%d{yyyy-MM-dd}-%i
appender.DRFA.layout.type=PatternLayout
appender.DRFA.layout.pattern=%d{DEFAULT} %-5p %c: [%t]: %m%n
appender.DRFA.policies.type=Policies
appender.DRFA.policies.size.type=SizeBasedTriggeringPolicy
appender.DRFA.policies.size.size=${max.log.file.size}
appender.DRFA.strategy.type=DefaultRolloverStrategy
appender.DRFA.strategy.max=${max.log.file.backup.index}
appender.DRFA.strategy.action.type=DELETE
appender.DRFA.strategy.action.basepath=${log.dir}
appender.DRFA.strategy.action.maxdepth=1
appender.DRFA.strategy.action.PathConditions.glob=${log.file}.*
appender.DRFA.strategy.action.PathConditions.type=IfFileName
appender.DRFA.strategy.action.PathConditions.nestedConditions.type=IfAccumulatedFileCount
appender.DRFA.strategy.action.PathConditions.nestedConditions.exceeds=${max.log.file.backup.index}
{code}
to roll the log files sometimes silently fails / does not do the cleanup.
Enabling DEBUG logs shows:
{code}
ERROR StatusLogger Unable to locate plugin for IfFileName
appender.DRFA.strategy.action.PathConditions.nestedConditions.type=IfAccumulatedFileCount
appender.DRFA.strategy.action.PathConditions.nestedConditions.exceeds=${max_log_backup_index}
DEBUG StatusLogger Building Plugin[name=Delete,
class=org.apache.logging.log4j.core.appender.rolling.action.DeleteAction].
ERROR StatusLogger Unable to invoke factory method in class
org.apache.logging.log4j.core.appender.rolling.action.DeleteAction for element
DELETE: java.lang.NullPointerException
java.lang.NullPointerException
at
org.apache.logging.log4j.core.config.plugins.visitors.PluginElementVisitor.findNamedNode(PluginElementVisitor.java:104)
at
org.apache.logging.log4j.core.config.plugins.visitors.PluginElementVisitor.visit(PluginElementVisitor.java:88)
at
org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.generateParameters(PluginBuilder.java:286)
at
org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:137)
at
org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1133)
at
org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1058)
at
org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1050)
at
org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1050)
at
org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1050)
at
org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:659)
{code}
We could not isolate how to trigger/reproduce this, but getting reports about
this issue.
We can see a bug in log4j related to this NPE:
https://github.com/apache/logging-log4j2/issues/1391
This affects the 2.18.0 version which we use currently in Hive and seems to be
fixed in 2.21.0.
Can we bump the log4j version to 2.21.0?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)