Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Status

Current state:"Under Discussion"

...

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Currently the kafka client will non-blocking connect to the broker, but if the broker’s OS system  shuts down or crashes, and the client is connecting to that node, it will waste a long time for the client to be aware of the connection can’t be reached. If the client is connecting the node to update metadata it will not connect to another node unless the previous connection is closed, then the client can’t send or receive message until it is aware of the connection is broken and try other node. This time is determined by the TCP connection parameters in the environment, sometime maybe several minutes.

...

So we want to add a connecting timeout to the client in this situation, it will timeout in a specified time and try to connect to other node to update metadata to avoid this issue.

Public Interfaces

This KIP will add a configuration in the client’s configuration file(both producer and consumer):

connect.timeout.ms: the connecting time out of one connection, default is 5000.

Proposed Changes

The change is as follow:

(1)     Add a connecting time to the network client.

...

(4)     If a channel is connected or closed, we will remove it from the connecting channel hash map.

.

Compatibility, Deprecation, and Migration Plan

The proposed change is backward compatible.


Rejected Alternatives

NA