Return-Path: X-Original-To: apmail-incubator-kafka-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-kafka-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 070E4DCBB for ; Wed, 8 Aug 2012 19:09:23 +0000 (UTC) Received: (qmail 1837 invoked by uid 500); 8 Aug 2012 19:09:21 -0000 Delivered-To: apmail-incubator-kafka-dev-archive@incubator.apache.org Received: (qmail 1699 invoked by uid 500); 8 Aug 2012 19:09:21 -0000 Mailing-List: contact kafka-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: kafka-dev@incubator.apache.org Delivered-To: mailing list kafka-dev@incubator.apache.org Received: (qmail 1382 invoked by uid 99); 8 Aug 2012 19:09:21 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Aug 2012 19:09:21 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 39A161427FB for ; Wed, 8 Aug 2012 19:09:21 +0000 (UTC) Date: Wed, 8 Aug 2012 19:09:21 +0000 (UTC) From: "Joel Koshy (JIRA)" To: kafka-dev@incubator.apache.org Message-ID: <324236773.1230.1344452961238.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1666638186.69036.1340917363851.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (KAFKA-379) TopicCount.constructTopicCount isn't thread-safe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KAFKA-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431304#comment-13431304 ] Joel Koshy commented on KAFKA-379: ---------------------------------- +1 > TopicCount.constructTopicCount isn't thread-safe > ------------------------------------------------ > > Key: KAFKA-379 > URL: https://issues.apache.org/jira/browse/KAFKA-379 > Project: Kafka > Issue Type: Bug > Components: clients > Affects Versions: 0.7, 0.8 > Reporter: Nick Howard > Attachments: TopicCount.scala.diff, kafka-379_0.8_v1.patch > > > TopicCount uses scala.util.parsing.json.JSON, which isn't thread-safe https://issues.scala-lang.org/browse/SI-4929 > If you have multiple consumers within the same JVM, and they all rebalance at the same time, you can get errors like the following: > [...] kafka.consumer.TopicCount$.constructTopicCount:39] ERROR: error parsing consumer json string [...] > java.lang.NullPointerException > at scala.util.parsing.combinator.Parsers$NoSuccess.(Parsers.scala:131) > at scala.util.parsing.combinator.Parsers$Failure.(Parsers.scala:158) > at scala.util.parsing.combinator.Parsers$$anonfun$acceptIf$1.apply(Parsers.scala:489) > ... > at scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:742) > at scala.util.parsing.json.JSON$.parseRaw(JSON.scala:71) > at scala.util.parsing.json.JSON$.parseFull(JSON.scala:85) > at kafka.consumer.TopicCount$.constructTopicCount(TopicCount.scala:32) > at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.kafka$consumer$ZookeeperConsumerConnector$ZKRebalancerListener$$getTopicCount(ZookeeperConsumerConnector.scala:422) > at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.kafka$consumer$ZookeeperConsumerConnector$ZKRebalancerListener$$rebalance(ZookeeperConsumerConnector.scala:460) > at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener$$anonfun$syncedRebalance$1.apply$mcVI$sp(ZookeeperConsumerConnector.scala:437) > at scala.collection.immutable.Range$ByOne$class.foreach$mVc$sp(Range.scala:282) > at scala.collection.immutable.Range$$anon$2.foreach$mVc$sp(Range.scala:265) > at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.syncedRebalance(ZookeeperConsumerConnector.scala:433) > at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.handleChildChange(ZookeeperConsumerConnector.scala:375) > at org.I0Itec.zkclient.ZkClient$7.run(ZkClient.java:568) > at org.I0Itec.zkclient.ZkEventThread.run(ZkEventThread.java:71) > I ran into this on 0.7.0, but the code in trunk appears to be vulnerable to the same issue. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira