KafkaProducer fails when many sockets are opened
See original GitHub issueWhen using KafkaProducer in an environment with over 1024 open sockets we get the following issue:
File "/srv/.../lib/python2.7/site-packages/kafka/producer/kafka.py", line 248, in __init__
self.config['api_version'] = client.check_version()
File "/srv/.../lib/python2.7/site-packages/kafka/client_async.py", line 639, in check_version
self.poll(future=f)
File "/srv/.../lib/python2.7/site-packages/kafka/client_async.py", line 367, in poll
responses.extend(self._poll(timeout, sleep=sleep))
File "/srv/.../lib/python2.7/site-packages/kafka/client_async.py", line 402, in _poll
ready, _, _ = select.select(fds, [], [], timeout)
ValueError: filedescriptor out of range in select()
AFAIK this is because the select() call is limited to FD_SETSIZE being 1024 on Linux.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Cannot run Kafka Producer due to socket.error - Stack Overflow
I have a local docker-machine and I am trying to run a Kafka producer written in python. However, it gives a socket.error: [Errno...
Read more >Kafka Producer Configurations for Confluent Platform
If the connection is not built before the timeout elapses, clients will close the socket channel. Type: long. Default: 10000 (10 seconds). Valid...
Read more >KafkaProducer — kafka-python 2.0.2-dev documentation
If the request fails, the producer can automatically retry, ... The message will immediately be added to the socket buffer and considered sent....
Read more >Critical Kafka Producer Config Parameters Simplified - Learn
But before getting started with Kafka Producer Configurations, ... will be immediately added to the socket buffer and considered sent.
Read more >How to Fix Apache Kafka Error, "NoBrokersAvailable" - Pandio
The no brokers available error is one of the most common standard errors in Apache Kafka. It usually occurs when you try to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
thanks for bug report! we’ll need to get more sophisticated here. one semi-related improvement is to add support for closing idle sockets (Issue #548). the real fix here may be to check for select alternatives (epoll / poll / etc).
I put up PR #640 to migrate to the selectors module and remove the explicit use of
select
. Please let me know if you have comments or have a moment to test whether this fixes your issue.