Skip to content

Commit 94f4c9b

Browse files
committed
Make the default connection timeout None
This fixes the default behavior, which used to cause a socket timeout when waiting for 10 seconds for a message to be produced.
1 parent 9644166 commit 94f4c9b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

kafka/conn.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ class KafkaConnection(local):
1717
by a call to `recv` in order to get the correct response. Eventually,
1818
we can do something in here to facilitate multiplexed requests/responses
1919
since the Kafka API includes a correlation id.
20+
21+
host: the host name or IP address of a kafka broker
22+
port: the port number the kafka broker is listening on
23+
timeout: default None. The socket timeout for sending and receiving data.
24+
None means no timeout, so a request can block forever.
2025
"""
21-
def __init__(self, host, port, timeout=10):
26+
def __init__(self, host, port, timeout=None):
2227
super(KafkaConnection, self).__init__()
2328
self.host = host
2429
self.port = port

0 commit comments

Comments
 (0)