Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-6370

MirrorMakerIntegrationTest#testCommaSeparatedRegex may fail due to NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Cannot Reproduce
    • None
    • None
    • None

    Description

      From https://builds.apache.org/job/kafka-trunk-jdk8/2277/testReport/junit/kafka.tools/MirrorMakerIntegrationTest/testCommaSeparatedRegex/ :

      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)
      

      Here is the code from KafkaMetricsGroup.scala :

              .map { case (key, value) => "%s.%s".format(key, value.replaceAll("\\.", "_"))}
      

      It seems (some) value was null.

      Attachments

        Activity

          People

            huxi_2b huxihx
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: