Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Producer silently swallows produce error if it does not have Write permissions #1847

Open
4 of 7 tasks
kahartma opened this issue Nov 12, 2024 · 0 comments
Open
4 of 7 tasks

Comments

@kahartma
Copy link

kahartma commented Nov 12, 2024

Description

We have a producer that produces to a topic and does not have Write permissions on it. If I would produce to it, I would expect the produce call to throw an exception. Instead, librdkafka only logs PARTCNT|rdkafka#producer-3| [thrd:ssl://localhost:9090/]: Topic test-topic partition count changed from 3 to 0.

I do produce an on_delivery callback and also call producer.flush() and producer.poll() after the produce.

I found some older related issues #738 and #704 which are already closed with v1.6.0, will provide improved authentication error reporting. There is also this recently opened issue #1787 for a similar problem on the consumer.

How to reproduce

Initialize a producer without Write permissions and then run

def delivery_report(err: KafkaError, msg: Message) -> None:
  raise RuntimeError(err)

producer.produce("topic", "value", on_delivery=delivery_report)
producer.flush(timeout=1.0)
producer.poll(timeout=0)

You will observe the log message, but no error will be raised.

Checklist

Please provide the following information:

  • confluent-kafka-python and librdkafka version (confluent_kafka.version() and confluent_kafka.libversion()): 2.6.0
  • Apache Kafka broker version: 3.7.1
  • Client configuration: {...}
  • Operating system:
  • Provide client logs (with 'debug': '..' as necessary)
  • Provide broker log excerpts
  • Critical issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant