You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Jaikiran Pai <ja...@gmail.com> on 2016/11/01 14:38:42 UTC

Re: NPEs for practically empty log

IMO, it's a bug and it shouldn't be throwing NPEs. If this is 
reproducible then maybe you can file a JIRA so that someone from the dev 
team can take a look.


-Jaikiran
On Friday 21 October 2016 10:37 AM, \u041c\u0430\u043a\u0441\u0438\u043c \u0413\u0443\u043c\u0435\u0440\u043e\u0432 wrote:
> Hi! I see WARNs on kafka startup even if I only have a single empty topic.
> Is it OK? Doesn't that mean I am going to run into real problems at some
> moment?
>
> That's the scenario, it's under Windows 10.
>
> I download and unzip kafka 2.11 (same story with 2.10), then I make changes
> to kafka-server-start.bat to direct JAVA_HOME to Oracle's 64-bit JRE, and
> to set KAFKA_HEAP_OPTS=-Xms2G -Xmx2G -XX:MaxPermSize=256m
>
> Then I run this:
>
> bin\windows\zookeeper-server-start config\zookeeper.properties
> bin\windows\kafka-server-start config\server.properties
> bin\windows\kafka-topics --create --zookeeper localhost:2181
> --replication-factor 1 --partitions 1 --topic requests
>
> Then I stop the Kafka server - either by terminating its process or with
> kafka-server-stop - and re-start it.
> And that's what I see in a log:
>
> [2016-10-21 09:50:19,830] WARN Error when freeing index buffer
> (kafka.log.OffsetIndex)
> java.lang.NullPointerException
>          at
> kafka.log.OffsetIndex.kafka$log$OffsetIndex$$forceUnmap(OffsetIndex.scala:310)
>          at
> kafka.log.OffsetIndex$$anonfun$resize$1.apply(OffsetIndex.scala:292)
>          at
> kafka.log.OffsetIndex$$anonfun$resize$1.apply(OffsetIndex.scala:285)
>          at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:231)
>          at kafka.log.OffsetIndex.resize(OffsetIndex.scala:285)
>          at kafka.log.LogSegment.recover(LogSegment.scala:174)
>          at kafka.log.Log.recoverLog(Log.scala:268)
>          at kafka.log.Log.loadSegments(Log.scala:243)
>          at kafka.log.Log.<init>(Log.scala:101)
>          at
> kafka.log.LogManager$$anonfun$loadLogs$2$$anonfun$3$$anonfun$apply$10$$anonfun$apply$1.apply$mcV$sp(LogManager.scala:152)
>          at kafka.utils.CoreUtils$$anon$1.run(CoreUtils.scala:56)
>          at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
> Source)
>          at java.util.concurrent.FutureTask.run(Unknown Source)
>          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
>          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
>          at java.lang.Thread.run(Unknown Source)
>
> To my understanding, there's no viable reason to have NPEs in production
> environment as an expected condition. So even if that's shown as a warning
> and is supposedly harmless, it looks like a bad symptom.
>
> Or I am just being paranoid and it's OK for Kafka server to have multiple
> NPEs on startup - even on an empty log, let alone a populated one?
>
> Maksim
>