Skip to content

Conversation

@accelerated
Copy link
Contributor

** Description **
Call flush termination callbacks from sync_produce. This allows sync_produce() to exhibit the same behavior as async_produce() when the rd_kafka underlying layer throws an error upon production. Flush callbacks, if registered, will now be called in both cases.
If the application passed some opaque correlation data via the user_data pointer and expected the delivery callback to be triggered on success or failure, in the failure case, this was not guaranteed to happen depending on the error type. For instance producing to a bad topic name, would cause all flushes to throw and no callbacks were ever invoked.

Note that sync_produce as well as async_produce can also be called during a flush, not only directly by the producer.

@mfontanini
Copy link
Owner

I can merge this now if it's ready, I can't follow what this class is doing anymore.

@accelerated
Copy link
Contributor Author

Sure, thanks! BTW I think the mirror for the rdkafka tarball is broken. There's a fix for this, you should consider merging as it's hard to tell w/o the CI tests.

@mfontanini
Copy link
Owner

Sorry, I thought there were still other problems on that one. Merged it, can you rebase when you have a chance?

@accelerated
Copy link
Contributor Author

@mfontanini it's good to go!

@mfontanini mfontanini merged commit a2056c3 into mfontanini:master Sep 1, 2020
@mfontanini
Copy link
Owner

Thanks sir!

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

Successfully merging this pull request may close these issues.

2 participants