Details
Description
Calling KafkaProducer.close() from multiple threads simultaneously may cause the following harmless error message to be logged. There appears to be a race-condition in AppInfoParser.unregisterAppInfo that we don't guard against.
WARN Error unregistering AppInfo mbean (org.apache.kafka.common.utils.AppInfoParser:71) javax.management.InstanceNotFoundException: kafka.producer:type=app-info,id=<client id> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:427) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:415) at com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:546) at org.apache.kafka.common.utils.AppInfoParser.unregisterAppInfo(AppInfoParser.java:69) at org.apache.kafka.clients.producer.KafkaProducer.close(KafkaProducer.java:735) at org.apache.kafka.clients.producer.KafkaProducer.close(KafkaProducer.java:686) at org.apache.kafka.clients.producer.KafkaProducer.close(KafkaProducer.java:665)
Attachments
Issue Links
- links to