[ https://issues.apache.org/jira/browse/KAFKA-6370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16292172#comment-16292172 ]
ASF GitHub Bot commented on KAFKA-6370: --------------------------------------- GitHub user huxihx opened a pull request: https://github.com/apache/kafka/pull/4327 KAFKA-6370: KafkaMetricsGroup.toScope should filter out tags null value KafkaMetricsGroup.toScope should filter out tags with value of `null` to avoid NullPointerException thrown. *More detailed description of your change, if necessary. The PR title and PR message become the squashed commit message, so use a separate comment to ping reviewers.* *Summary of testing strategy (including rationale) for the feature or bug fix. Unit and/or integration tests are expected for any behaviour change and system tests should be considered for larger changes.* ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) You can merge this pull request into a Git repository by running: $ git pull https://github.com/huxihx/kafka KAFKA-6370 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/4327.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #4327 ---- commit 9eec15c5f231cb6c5ec17cc62783031775d69b74 Author: huxihx <huxi...@hotmail.com> Date: 2017-12-15T08:05:52Z KAFKA-6370: KafkaMetricsGroup.toScope should filter out tags with value of `null` to avoid NullPointerException thrown. ---- > MirrorMakerIntegrationTest#testCommaSeparatedRegex may fail due to > NullPointerException > --------------------------------------------------------------------------------------- > > Key: KAFKA-6370 > URL: https://issues.apache.org/jira/browse/KAFKA-6370 > Project: Kafka > Issue Type: Bug > Reporter: Ted Yu > Assignee: huxihx > Priority: Minor > > From > https://builds.apache.org/job/kafka-trunk-jdk8/2277/testReport/junit/kafka.tools/MirrorMakerIntegrationTest/testCommaSeparatedRegex/ > : > {code} > java.lang.NullPointerException > at > scala.collection.immutable.StringLike.$anonfun$format$1(StringLike.scala:351) > at > scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234) > at > scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:32) > at > scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:29) > at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:38) > at scala.collection.TraversableLike.map(TraversableLike.scala:234) > at scala.collection.TraversableLike.map$(TraversableLike.scala:227) > at scala.collection.AbstractTraversable.map(Traversable.scala:104) > at scala.collection.immutable.StringLike.format(StringLike.scala:351) > at scala.collection.immutable.StringLike.format$(StringLike.scala:350) > at scala.collection.immutable.StringOps.format(StringOps.scala:29) > at > kafka.metrics.KafkaMetricsGroup$.$anonfun$toScope$3(KafkaMetricsGroup.scala:170) > at scala.collection.immutable.List.map(List.scala:283) > at > kafka.metrics.KafkaMetricsGroup$.kafka$metrics$KafkaMetricsGroup$$toScope(KafkaMetricsGroup.scala:170) > at > kafka.metrics.KafkaMetricsGroup.explicitMetricName(KafkaMetricsGroup.scala:67) > at > kafka.metrics.KafkaMetricsGroup.explicitMetricName$(KafkaMetricsGroup.scala:51) > at > kafka.network.RequestMetrics.explicitMetricName(RequestChannel.scala:352) > at > kafka.metrics.KafkaMetricsGroup.metricName(KafkaMetricsGroup.scala:47) > at > kafka.metrics.KafkaMetricsGroup.metricName$(KafkaMetricsGroup.scala:42) > at kafka.network.RequestMetrics.metricName(RequestChannel.scala:352) > at > kafka.metrics.KafkaMetricsGroup.newHistogram(KafkaMetricsGroup.scala:81) > at > kafka.metrics.KafkaMetricsGroup.newHistogram$(KafkaMetricsGroup.scala:80) > at kafka.network.RequestMetrics.newHistogram(RequestChannel.scala:352) > at kafka.network.RequestMetrics.<init>(RequestChannel.scala:364) > at > kafka.network.RequestChannel$Metrics.$anonfun$new$2(RequestChannel.scala:57) > at > scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:59) > at > scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:52) > at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) > at kafka.network.RequestChannel$Metrics.<init>(RequestChannel.scala:56) > at kafka.network.RequestChannel.<init>(RequestChannel.scala:243) > at kafka.network.SocketServer.<init>(SocketServer.scala:71) > at kafka.server.KafkaServer.startup(KafkaServer.scala:238) > at kafka.utils.TestUtils$.createServer(TestUtils.scala:135) > at > kafka.integration.KafkaServerTestHarness.$anonfun$setUp$1(KafkaServerTestHarness.scala:93) > {code} > Here is the code from KafkaMetricsGroup.scala : > {code} > .map { case (key, value) => "%s.%s".format(key, > value.replaceAll("\\.", "_"))} > {code} > It seems (some) value was null. -- This message was sent by Atlassian JIRA (v6.4.14#64029)