MINOR: Logs warning message when user invoke producer#flush within callback#18112
Merged
AndrewJSchofield merged 1 commit intoapache:trunkfrom Dec 10, 2024
Merged
Conversation
3 tasks
chia7712
reviewed
Dec 10, 2024
Member
chia7712
left a comment
There was a problem hiding this comment.
@frankvicky thanks for this patch
| </li> | ||
| <li>The deprecated <code>sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata>, String)</code> method has been removed from the Producer API. | ||
| </li> | ||
| <li>The <code>flush</code> method now detects potential deadlocks and logs a warning when used inside a callback. |
Member
There was a problem hiding this comment.
this is unnecessary as it is just a log.
Member
There was a problem hiding this comment.
Personally, I tend the other way on this. If someone is now getting errors logged, this explains why. No big deal either way, I suppose. Just my 2 cents.
ece977f to
4a69ffa
Compare
AndrewJSchofield
requested changes
Dec 10, 2024
Member
AndrewJSchofield
left a comment
There was a problem hiding this comment.
Thanks for the PR. Just one nit to fix.
| * </p> | ||
| * <p> | ||
| * <b>Important:</b> This method should not be used within the callback provided to | ||
| * {@link #send(ProducerRecord, Callback)}.Invoking <code>flush()</code> in this context will cause a deadlock. |
Member
There was a problem hiding this comment.
nit: Space before "Invoking" please.
Contributor
Author
There was a problem hiding this comment.
Thanks for pointing out 😺
4a69ffa to
3723114
Compare
AndrewJSchofield
approved these changes
Dec 10, 2024
peterxcli
pushed a commit
to peterxcli/kafka
that referenced
this pull request
Dec 18, 2024
…llback (apache#18112) Reviewers: Andrew Schofield <aschofield@confluent.io>
tedyu
pushed a commit
to tedyu/kafka
that referenced
this pull request
Jan 6, 2025
…llback (apache#18112) Reviewers: Andrew Schofield <aschofield@confluent.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As title.
Please refer to the discussion of #17946 for further details
Committer Checklist (excluded from commit message)