You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/04/22 12:26:43 UTC

[GitHub] [pulsar] liudezhi2098 opened a new issue, #15274: [Funtion] Log4jLogger caught java.lang.NullPointerException logging ParameterizedMessage

liudezhi2098 opened a new issue, #15274:
URL: https://github.com/apache/pulsar/issues/15274

   **Describe the bug**
   when `pulsar.log.root.level = debug` ,   if use context.getLogger(), will keep reporting error.
   ```
   2022-04-22 20:13:46,234 public/default/function1-0 WARN org.apache.logging.slf4j.Log4jLogger caught java.lang.NullPointerException logging ParameterizedMessage: [{}] [{}] add message to batch, num messages in batch so far {} java.lang.NullPointerException
   	at org.apache.logging.log4j.core.config.AppenderControl.appenderErrorHandlerMessage(AppenderControl.java:118)
   	at org.apache.logging.log4j.core.config.AppenderControl.isRecursiveCall(AppenderControl.java:110)
   	at org.apache.logging.log4j.core.config.AppenderControl.shouldSkip(AppenderControl.java:93)
   	at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:86)
   	at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:542)
   	at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:500)
   	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:483)
   	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:417)
   	at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:82)
   	at org.apache.logging.log4j.core.Logger.log(Logger.java:161)
   	at org.apache.logging.log4j.spi.AbstractLogger.tryLogMessage(AbstractLogger.java:2205)
   	at org.apache.logging.log4j.spi.AbstractLogger.logMessageTrackRecursion(AbstractLogger.java:2159)
   	at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2142)
   	at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2028)
   	at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1891)
   	at org.apache.logging.slf4j.Log4jLogger.debug(Log4jLogger.java:134)
   	at org.apache.pulsar.client.impl.BatchMessageContainerImpl.add(BatchMessageContainerImpl.java:61)
   	at org.apache.pulsar.client.impl.ProducerImpl.serializeAndSendMessage(ProducerImpl.java:640)
   	at org.apache.pulsar.client.impl.ProducerImpl.sendAsync(ProducerImpl.java:554)
   	at org.apache.pulsar.client.impl.ProducerImpl.internalSendAsync(ProducerImpl.java:339)
   	at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.sendAsync(TypedMessageBuilderImpl.java:101)
   	at org.apache.pulsar.functions.instance.LogAppender.append(LogAppender.java:59)
   	at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:161)
   	at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:134)
   	at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:125)
   	at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:89)
   	at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:542)
   	at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:500)
   	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:483)
   	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:417)
   	at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:82)
   	at org.apache.logging.log4j.core.Logger.log(Logger.java:161)
   	at org.apache.logging.log4j.spi.AbstractLogger.tryLogMessage(AbstractLogger.java:2205)
   	at org.apache.logging.log4j.spi.AbstractLogger.logMessageTrackRecursion(AbstractLogger.java:2159)
   	at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2142)
   	at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2028)
   	at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1891)
   	at org.apache.logging.slf4j.Log4jLogger.debug(Log4jLogger.java:134)
   	at org.apache.pulsar.client.impl.BatchMessageContainerImpl.add(BatchMessageContainerImpl.java:61)
   	at org.apache.pulsar.client.impl.ProducerImpl.serializeAndSendMessage(ProducerImpl.java:640)
   	at org.apache.pulsar.client.impl.ProducerImpl.sendAsync(ProducerImpl.java:554)
   	at org.apache.pulsar.client.impl.ProducerImpl.internalSendAsync(ProducerImpl.java:339)
   	at org.apache.pulsar.client.impl.TypedMessageBuilderImpl.sendAsync(TypedMessageBuilderImpl.java:101)
   	at org.apache.pulsar.functions.instance.ContextImpl$MessageBuilderImpl.sendAsync(ContextImpl.java:610)
   	at org.apache.pulsar.functions.instance.ContextImpl.publish(ContextImpl.java:484)
   	at org.apache.pulsar.functions.instance.ContextImpl.publish(ContextImpl.java:453)
   	at org.apache.pulsar.functions.windowing.WindowFunctionExecutor.processWindow(WindowFunctionExecutor.java:237)
   	at org.apache.pulsar.functions.windowing.WindowFunctionExecutor.access$000(WindowFunctionExecutor.java:48)
   	at org.apache.pulsar.functions.windowing.WindowFunctionExecutor$1.onActivation(WindowFunctionExecutor.java:215)
   	at org.apache.pulsar.functions.windowing.WindowManager.onTrigger(WindowManager.java:150)
   	at org.apache.pulsar.functions.windowing.triggers.CountTriggerPolicy.track(CountTriggerPolicy.java:55)
   	at org.apache.pulsar.functions.windowing.WindowManager.track(WindowManager.java:183)
   	at org.apache.pulsar.functions.windowing.WindowManager.add(WindowManager.java:111)
   	at org.apache.pulsar.functions.windowing.WindowManager.add(WindowManager.java:94)
   	at org.apache.pulsar.functions.windowing.WindowFunctionExecutor.process(WindowFunctionExecutor.java:295)
   	at org.apache.pulsar.functions.instance.JavaInstance.handleMessage(JavaInstance.java:96)
   	at org.apache.pulsar.functions.instance.JavaInstanceRunnable.run(JavaInstanceRunnable.java:289)
   	at java.base/java.lang.Thread.run(Thread.java:834)
   ```
    same problem #14228
   **To Reproduce**
   
   alert conf/log4j2.yaml
   
   ```
   - name: "pulsar.log.root.level"
           value: "debug"
   ```
   
   ```
   public class FunctionLog implements Function<String, String> {
   
       @Override
       public String process(String input, Context context) throws Exception {
           Logger LOG = context.getLogger();
           LOG.info("this is log {}", input);
           return null;
       }
   }
   ```
   
   `sh pulsar-admin functions localrun`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] liudezhi2098 commented on issue #15274: [Function] Log4jLogger caught java.lang.NullPointerException logging ParameterizedMessage

Posted by GitBox <gi...@apache.org>.
liudezhi2098 commented on issue #15274:
URL: https://github.com/apache/pulsar/issues/15274#issuecomment-1131740070

   
   @nlu90 Did you find the cause of this problem?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] nlu90 commented on issue #15274: [Function] Log4jLogger caught java.lang.NullPointerException logging ParameterizedMessage

Posted by GitBox <gi...@apache.org>.
nlu90 commented on issue #15274:
URL: https://github.com/apache/pulsar/issues/15274#issuecomment-1110329342

   I can help take a look later this week.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] mattisonchao closed issue #15274: [Function] Log4jLogger caught java.lang.NullPointerException logging ParameterizedMessage

Posted by GitBox <gi...@apache.org>.
mattisonchao closed issue #15274: [Function] Log4jLogger caught java.lang.NullPointerException logging ParameterizedMessage
URL: https://github.com/apache/pulsar/issues/15274


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] nlu90 commented on issue #15274: [Function] Log4jLogger caught java.lang.NullPointerException logging ParameterizedMessage

Posted by GitBox <gi...@apache.org>.
nlu90 commented on issue #15274:
URL: https://github.com/apache/pulsar/issues/15274#issuecomment-1135080576

   @liudezhi2098 Based on a discussion with @freeznet, we think it's related to uninitialized error handler in `LogAppender` class


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org