9

I am using Kafka 0.8.2.0 (Scala 2.10). In my log files, I see the following message intermittently. This seems like a connectivity issue, but I'm running both in my localhost.

Is this a harmless warning message or should I do something to avoid it?

2015-10-30 14:12:38.015  WARN 4251 --- [ad | producer-1] [                                    ] o.apache.kafka.common.network.Selector   : Error in I/O with localhost/127.0.0.1

java.io.EOFException: null
    at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:62)
    at org.apache.kafka.common.network.Selector.poll(Selector.java:248)
    at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:192)
    at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:191)
    at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:122)
    at java.lang.Thread.run(Thread.java:745)
Yohan Liyanage
  • 6,840
  • 3
  • 46
  • 63

3 Answers3

16

This is a bit later to the party, but may help someone - it would have helped me.

What you're seeing occurs because the Kafka broker is passively closing the connection after a certain period of idleness is exceeded. It's defined by this broker property: connections.max.idle.ms - the default is 10 minutes.

Apparently the kafka client in 0.8.x doesn't honour that setting and just leaves idle connections open. You'll see the warning in your logs but it should have no bad effect on your application.

More details here: https://issues.apache.org/jira/browse/KAFKA-3205

The broker config is documented here: https://kafka.apache.org/090/documentation/#configuration

In that table you'll find:

Name: connections.max.idle.ms
Description: Idle connections timeout: the server socket processor threads close the connections that idle more than this
Type:long
Default: 600000

Hope that helps.

Phil Brock
  • 402
  • 4
  • 6
2

I have faced this issue while running the Kafka streams application using the Kafka broker of 0.8

I have tried changing the config provided by @Phil Brock in the above answer. But that did not seem to have any impact on it.

Upgrading the Kafka broker to 2.x has only seemed to be the working solution for me.

When I looked for the Kafka streams version compatibility, I got this

Note, that a brokers must be on version 0.10. 1 or higher to run a Kafka Streams application version 0.10. 1 or higher; On-disk message format must be 0.10 or higher to run a Kafka Streams application version 1.0 or higher.

Ajay Kr Choudhary
  • 1,304
  • 1
  • 14
  • 23
0

It seems like your producer can not connect to kafka broker. I suggest you try to send some messages with kafka console producer in order to verify your system is configured properly.

codejitsu
  • 3,162
  • 2
  • 24
  • 38
  • 2
    The problem is it is working fine although I see this message. This message comes at random times. But the application is working fine so far. Just worried to see this exception popping up at random intervals. – Yohan Liyanage Oct 30 '15 at 11:24
  • @YohanLiyanage I see, in fact kafka logs a lot of information. – codejitsu Oct 30 '15 at 11:32