My broker logs are full of messages of the following type of log message:

INFO  [kafka-network-thread-9092-1        ] [kafka.network.Processor
      ]: Closing socket connection to /some_ip_that_I_know.

I see at least one every 4-5  seconds. Something I identified was that the
ip of the closed clients was always from one class of application. This
application mostly consumes kafka partitions (rarely produces) and it uses
the SimpleConsumer to consume data, make requests about partition
leadership (to keep it up to date) and to also make requests about the
latest offset in a set of partitions (for metrics).

The data consumption happens with long running consumers, but the one off
requests like partition leadership requests and offset queries happen with
short-lived consumers that are closed after a request is served. However
the volume of closing "Closing socket connection" log messages is higher
than what I think the rate of these short lived requests should be. My
guess is that something else is going on.

Is there a way for me to track what client is exactly having its connection
closed? Each of my SimpleConsumer clients uses a particular client name
when connecting to the broker. Is there a way to enable additional logging
which would give me this data along with the "Closing socket connection"
message?

Thanks,

Rajiv

Reply via email to