confluentinc / confluent-kafka-python

Confluent's Kafka Python Client
http://docs.confluent.io/current/clients/confluent-kafka-python
Other
108 stars 895 forks source link

Timeout Option for SchemaRegistryClient #905

Open snazzyfox opened 4 years ago

snazzyfox commented 4 years ago

Description

SchemaRegistryClient does not supply a timeout to the underlying calls to requests. If a network issue causes no data to be returned (such as firewall/security group misconfiguration), the client will wait forever instead of raising a timeout error. This essentially causes the application to hang.

We should add a new configuration option to SchemaRegistryClient that sets the timeout so that an error may be raised/caught in these situations.

How to reproduce

With a blackhole server running locally, for example on port 8000

from confluent_kafka.schema_registry import SchemaRegistryClient
client = SchemaRegistryClient({'url': 'localhost:8000'})
client.get_subjects()  # this will hang forever

Checklist

Please provide the following information:

zschumacher commented 2 years ago

Any update on this? It is still an issue for us at @Simplebet and probably others

jliunyu commented 2 years ago

We are looking into this issue.

slominskir commented 2 years ago

Duplicate of https://github.com/confluentinc/confluent-kafka-python/issues/622

chipola commented 7 months ago

It looks like there's a PR submitted, can we get someone from the team to take a look? cc: @jliunyu