confluent-kafka-python icon indicating copy to clipboard operation
confluent-kafka-python copied to clipboard

Timeout Option for SchemaRegistryClient

Open snazzyfox opened this issue 4 years ago • 4 comments

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:

  • [x] confluent-kafka-python and librdkafka version (confluent_kafka.version() and confluent_kafka.libversion()): both 1.4.2
  • [ ] Apache Kafka broker version: irrelevant
  • [ ] Client configuration: {...}: irrelevant
  • [x] Operating system: Probably irrelevant since schema registry client is pure python, but reproduced on ubuntu 20.04, amazon linux 2, and windows 10
  • [ ] Provide client logs (with 'debug': '..' as necessary)
  • [ ] Provide broker log excerpts
  • [ ] Critical issue

snazzyfox avatar Jun 30 '20 19:06 snazzyfox

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

zschumacher avatar Jan 26 '22 15:01 zschumacher

We are looking into this issue.

jliunyu avatar Feb 01 '22 22:02 jliunyu

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

slominskir avatar Apr 27 '22 23:04 slominskir

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

chipola avatar Mar 27 '24 22:03 chipola