Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-5298

MalformedObjectNameException in ConnectionMetrics for IPv6 nodes because of ":" characters

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 1.2.3
    • Component/s: None
    • Labels:
      None
    • Severity:
      Low

      Description

      After upgrading node to 1.2.1, during C* startup, for all ConnectionMetrics I get exception like this one:

       WARN [GossipStage:1] 2013-02-27 12:14:55,431 JmxReporter.java (line 388) Error processing org.apache.cassandra.metrics:type=Connection,scope=2001:4c28:20:177:0:1:2:4,name=Timeouts
      javax.management.MalformedObjectNameException: Invalid character ':' in value part of property
      	at javax.management.ObjectName.construct(ObjectName.java:602)
      	at javax.management.ObjectName.<init>(ObjectName.java:1403)
      	at com.yammer.metrics.reporting.JmxReporter.onMetricAdded(JmxReporter.java:386)
      	at com.yammer.metrics.core.MetricsRegistry.notifyMetricAdded(MetricsRegistry.java:516)
      	at com.yammer.metrics.core.MetricsRegistry.getOrAdd(MetricsRegistry.java:491)
      	at com.yammer.metrics.core.MetricsRegistry.newMeter(MetricsRegistry.java:240)
      	at com.yammer.metrics.Metrics.newMeter(Metrics.java:245)
      	at org.apache.cassandra.metrics.ConnectionMetrics.<init>(ConnectionMetrics.java:102)
      	at org.apache.cassandra.net.OutboundTcpConnectionPool.<init>(OutboundTcpConnectionPool.java:53)
      	at org.apache.cassandra.net.MessagingService.getConnectionPool(MessagingService.java:481)
      	at org.apache.cassandra.net.MessagingService.getConnection(MessagingService.java:489)
      	at org.apache.cassandra.net.MessagingService.sendOneWay(MessagingService.java:612)
      	at org.apache.cassandra.net.MessagingService.sendOneWay(MessagingService.java:581)
      	at org.apache.cassandra.gms.GossipDigestSynVerbHandler.doVerb(GossipDigestSynVerbHandler.java:85)
      	at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:56)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:662)
      
      (...)

      Looking at ObjectName source code (e.g. http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/javax/management/ObjectName.java ) I can see that ":" is not a valid character, so my idea for solving this problem is to use one of the following:

      1) URLEncode.encode() - seems to be more "proper" solution, but produces a bit unreadable metric scope like: MBean org.apache.cassandra.metrics:type=Connection,scope=2001%3A4c28%3A10%3A168%3A0%3A2%3A3%3A6,name=CommandCompletedTasks

      2) <String>.replaceAll() - we can simply replace ":" with "." which wouldn't give us valid IPv6 address, but will be much more readable.

      Second one seems to be a better choice for me, but I attach two patches.

        Attachments

        1. ipv6-connection-metrics-replaceAll.patch
          0.7 kB
          Michał Michalski
        2. ipv6-connection-metrics-URLEncoder.patch
          1 kB
          Michał Michalski

          Activity

            People

            • Assignee:
              michalm Michał Michalski
              Reporter:
              michalm Michał Michalski
              Authors:
              Michał Michalski
              Reviewers:
              Jonathan Ellis
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: