Return-Path: X-Original-To: apmail-kafka-users-archive@www.apache.org Delivered-To: apmail-kafka-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 20FD810695 for ; Wed, 8 May 2013 15:23:08 +0000 (UTC) Received: (qmail 85921 invoked by uid 500); 8 May 2013 15:23:07 -0000 Delivered-To: apmail-kafka-users-archive@kafka.apache.org Received: (qmail 85871 invoked by uid 500); 8 May 2013 15:23:07 -0000 Mailing-List: contact users-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@kafka.apache.org Delivered-To: mailing list users@kafka.apache.org Received: (qmail 85861 invoked by uid 99); 8 May 2013 15:23:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 May 2013 15:23:07 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of junrao@gmail.com designates 209.85.214.182 as permitted sender) Received: from [209.85.214.182] (HELO mail-ob0-f182.google.com) (209.85.214.182) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 May 2013 15:23:03 +0000 Received: by mail-ob0-f182.google.com with SMTP id eh20so1818279obb.27 for ; Wed, 08 May 2013 08:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=8o66ygAKHqxSg5JLwhaakYVSfoyYiHF1Yq7KjsAbQhE=; b=jBKa3ZoCtMnomCjnzrDrIRDp1UDfGi4JPr5xBJ/lTZ52Ek4ShIXn6wXOFzBSi12ecn 77cwnTjB3up1m2ZJrkHUClawWYnEFj6ctYs7Bl+GTQWcss37uI4UIYDQQ50Zdjix/AiC 4xMSrx2+wBDZ4VzSVBbjMGBcL9KUH+y8MKSQuZ3mozsUomqcXKWtDzredYvmIqjol//z aK7YbOGwVlYl9YUCG7bCNJvt4Yn7+RTr1fYs09GBQpbA3I8/w/Zxc/wDzO1ogfHyCdtO j0Nzye7ESF904mHAYoq37A9k8dQz7BHi7YHgx+UNSWINav+zRq5D52dN4G7D00jHZ9vF S4aw== MIME-Version: 1.0 X-Received: by 10.182.118.42 with SMTP id kj10mr2208131obb.99.1368026562656; Wed, 08 May 2013 08:22:42 -0700 (PDT) Received: by 10.60.1.137 with HTTP; Wed, 8 May 2013 08:22:42 -0700 (PDT) In-Reply-To: References: Date: Wed, 8 May 2013 08:22:42 -0700 Message-ID: Subject: Re: expected exceptions? From: Jun Rao To: "users@kafka.apache.org" Content-Type: multipart/alternative; boundary=f46d0447878d4f834604dc3681bd X-Virus-Checked: Checked by ClamAV on apache.org --f46d0447878d4f834604dc3681bd Content-Type: text/plain; charset=ISO-8859-1 Yes, both are expected. Thanks, Jun On Wed, May 8, 2013 at 12:16 AM, Jason Rosenberg wrote: > I'm porting some unit tests from 0.7.2 to 0.8.0. The test does the > following, all embedded in the same java process: > > -- spins up a zk instance > -- spins up a kafka server using a fresh log directory > -- creates a producer and sends a message > -- creates a high-level consumer and verifies that it can consume the > message > -- shuts down the consumer > -- stops the kafka server > -- stops zk > > The test seems to be working fine now, however, I consistently see the > following exceptions (which from poking around the mailing list seem to be > expected?). If these are expected, can we suppress the logging of these > exceptions, since it clutters the output of tests, and presumably, clutters > the logs of the running server/consumers, during clean startup and > shutdown...... > > When I call producer.send(), I get: > > kafka.common.LeaderNotAvailableException: No leader for any partition > at > > kafka.producer.async.DefaultEventHandler.kafka$producer$async$DefaultEventHandler$$getPartition(DefaultEventHandler.scala:212) > at > > kafka.producer.async.DefaultEventHandler$$anonfun$partitionAndCollate$1.apply(DefaultEventHandler.scala:150) > at > > kafka.producer.async.DefaultEventHandler$$anonfun$partitionAndCollate$1.apply(DefaultEventHandler.scala:148) > at > > scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:57) > at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:43) > at > > kafka.producer.async.DefaultEventHandler.partitionAndCollate(DefaultEventHandler.scala:148) > at > > kafka.producer.async.DefaultEventHandler.dispatchSerializedData(DefaultEventHandler.scala:94) > at > > kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:72) > at kafka.producer.Producer.send(Producer.scala:74) > at kafka.javaapi.producer.Producer.send(Producer.scala:32) > ... > ... > > When I call consumerConnector.shutdown(), I get: > > java.nio.channels.ClosedByInterruptException > at > > java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:184) > at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:543) > at kafka.network.BlockingChannel.connect(BlockingChannel.scala:57) > at kafka.consumer.SimpleConsumer.connect(SimpleConsumer.scala:47) > at kafka.consumer.SimpleConsumer.reconnect(SimpleConsumer.scala:60) > at kafka.consumer.SimpleConsumer.liftedTree1$1(SimpleConsumer.scala:81) > at > > kafka.consumer.SimpleConsumer.kafka$consumer$SimpleConsumer$$sendRequest(SimpleConsumer.scala:73) > at > > kafka.consumer.SimpleConsumer$$anonfun$fetch$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(SimpleConsumer.scala:112) > at > > kafka.consumer.SimpleConsumer$$anonfun$fetch$1$$anonfun$apply$mcV$sp$1.apply(SimpleConsumer.scala:112) > at > > kafka.consumer.SimpleConsumer$$anonfun$fetch$1$$anonfun$apply$mcV$sp$1.apply(SimpleConsumer.scala:112) > at kafka.metrics.KafkaTimer.time(KafkaTimer.scala:33) > at > > kafka.consumer.SimpleConsumer$$anonfun$fetch$1.apply$mcV$sp(SimpleConsumer.scala:111) > at > > kafka.consumer.SimpleConsumer$$anonfun$fetch$1.apply(SimpleConsumer.scala:111) > at > > kafka.consumer.SimpleConsumer$$anonfun$fetch$1.apply(SimpleConsumer.scala:111) > at kafka.metrics.KafkaTimer.time(KafkaTimer.scala:33) > at kafka.consumer.SimpleConsumer.fetch(SimpleConsumer.scala:110) > at > > kafka.server.AbstractFetcherThread.processFetchRequest(AbstractFetcherThread.scala:96) > at > kafka.server.AbstractFetcherThread.doWork(AbstractFetcherThread.scala:88) > at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:51) > > Jason > --f46d0447878d4f834604dc3681bd--