confluent-kafka-python
confluent-kafka-python copied to clipboard
Future hangs indefinetly when removed from the dict it is returned with.
Description
When i remove futures returned by methods of the AdminClient from the dict they are originally contained in, any calls to the result and exception method hang indefinitely.
How to reproduce
from confluent_kafka.admin import AdminClient, ConfigResource
client = AdminClient({"bootstrap.servers": "localhost"})
resource = ConfigResource("topic", "dev.test")
req_descriptions = client.describe_configs([resource])
value_list = req_descriptions[resource]
# Uncommenting the following line will cause future to hang indefinitely
# key, value_pop = req_descriptions.popitem()
print(value_list.result())
Checklist
Please provide the following information:
- [X] confluent-kafka-python version ('1.7.0', 17235968) librdkafka version ('1.7.0', 17236223 )
- [X] Apache Kafka broker version: Docker Container: wurstmeister/kafka 2.12-2.0.1
- [X] Client configuration: {"bootstrap.servers": "localhost"}
- [X] Operating system: Ubuntu 20.4 Python 3.8.10
- [ ] Provide client logs (with
'debug': '..'as necessary) - [X] Provide broker log excerpts
- [ ] Critical issue
Hi @mkstickx , thanks for reporting this.
I just reproduced the issue, if removed the futures from the dict, the future status keeps as running without complete.
If you don't have special requirement to remove the futures from the dict fist, please keep them in the dict when you use them. We are looking into a fix to it.
please can this be documented via type hints? I've just spent several hours on this exact same issue before I came across this ticket.