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

flush leaves messages remaining #1817

Open
4 of 7 tasks
coneybeare opened this issue Sep 19, 2024 · 1 comment
Open
4 of 7 tasks

flush leaves messages remaining #1817

coneybeare opened this issue Sep 19, 2024 · 1 comment

Comments

@coneybeare
Copy link

Description

I call flush in my setup and expect the message to be sent, and no warning produced, but a simple test of having one message produced, then a flush, leaves the following output

>>> print(KafkaProducer().flush())
%4|1726771494.331|TERMINATE|rdkafka#producer-8| [thrd:app]: Producer terminating with 1 message (3328 bytes) still in queue or transit: use flush() to wait for outstanding message delivery
None

You see that None is returned indicating the messages are sent, but I still get the Producer terminating message. Not sure how best to proceed.

How to reproduce

Produce a message with a payload, don't poll, but call flush

>>> print(KafkaProducer().flush())
%4|1726771494.331|TERMINATE|rdkafka#producer-8| [thrd:app]: Producer terminating with 1 message (3328 bytes) still in queue or transit: use flush() to wait for outstanding message delivery
None

Checklist

Please provide the following information:

  • confluent-kafka-python and librdkafka version (confluent_kafka.version() and confluent_kafka.libversion()): ('2.5.0', 33882112), ('2.5.0', 33882367)
  • Apache Kafka broker version: 3.5.1 through AWS MSK
  • Client configuration: { "api.version.request": False, "bootstrap.servers": 'msk_server_1,msk_server_2', "security.protocol": "SSL", "ssl.ca.location": 'path/to/local/ssl/cert/, }
  • Operating system: Debian
  • Provide client logs (with 'debug': '..' as necessary)
  • Provide broker log excerpts
  • Critical issue
@joaoe
Copy link

joaoe commented Sep 30, 2024

Workaround for you

while len(producer): producer.flush()

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

2 participants