Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9ac3cb1

Browse files
committed
Document connections_max_idle_ms
This was added in #1068 but never documented. Fix #1497
1 parent bc4cc43 commit 9ac3cb1

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

kafka/client_async.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ class KafkaClient(object):
7979
the computed value. Default: 1000.
8080
request_timeout_ms (int): Client request timeout in milliseconds.
8181
Default: 30000.
82+
connections_max_idle_ms: Close idle connections after the number of
83+
milliseconds specified by this config. The broker closes idle
84+
connections after connections.max.idle.ms, so this avoids hitting
85+
unexpected socket disconnected errors on the client.
86+
Default: 540000
8287
retry_backoff_ms (int): Milliseconds to backoff when retrying on
8388
errors. Default: 100.
8489
max_in_flight_requests_per_connection (int): Requests are pipelined

kafka/consumer/group.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ class KafkaConsumer(six.Iterator):
212212
api_version_auto_timeout_ms (int): number of milliseconds to throw a
213213
timeout exception from the constructor when checking the broker
214214
api version. Only applies if api_version set to 'auto'
215+
connections_max_idle_ms: Close idle connections after the number of
216+
milliseconds specified by this config. The broker closes idle
217+
connections after connections.max.idle.ms, so this avoids hitting
218+
unexpected socket disconnected errors on the client.
219+
Default: 540000
215220
metric_reporters (list): A list of classes to use as metrics reporters.
216221
Implementing the AbstractMetricsReporter interface allows plugging
217222
in classes that will be notified of new metric creation. Default: []

kafka/producer/kafka.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ class KafkaProducer(object):
171171
will block up to max_block_ms, raising an exception on timeout.
172172
In the current implementation, this setting is an approximation.
173173
Default: 33554432 (32MB)
174+
connections_max_idle_ms: Close idle connections after the number of
175+
milliseconds specified by this config. The broker closes idle
176+
connections after connections.max.idle.ms, so this avoids hitting
177+
unexpected socket disconnected errors on the client.
178+
Default: 540000
174179
max_block_ms (int): Number of milliseconds to block during
175180
:meth:`~kafka.KafkaProducer.send` and
176181
:meth:`~kafka.KafkaProducer.partitions_for`. These methods can be

0 commit comments

Comments
 (0)