-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
KAFKA-18873: Fixed incorrect error message when exceeds 5 for transactional producers #19041
base: trunk
Are you sure you want to change the base?
KAFKA-18873: Fixed incorrect error message when exceeds 5 for transactional producers #19041
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @EsMoX!
I'm a little surprised that this test bug exists. Either this test has been failing for awhile, or something was changed in the ProducerConfig
logic to change the message. Do you have any idea when this test started failing?
Thanks!
|
Thank you for your feedback, @kirktrue! I looked into the issue, and it seems that this problem may have existed for some time. The test likely started failing due to a change in the ProducerConfig logic that altered the exception prioritization, resulting in a mismatch between the expected and actual error messages. However, I couldn't pinpoint the exact commit or version where this change occurred. If it’s helpful, I can investigate further to identify when this behavior was introduced. Let me know if you'd like me to proceed with that! Thanks again for reviewing the PR! |
cc @mjsax |
I'll let Matthias (or someone else) decide if it's worth pursuing where this crept in. Thanks again for the PR 😄 |
Thanks for the PR. Seems there is some confusion about this test... First, the test was added like this 2 year ago and never modified. So it was missed on the original PR review 7c280c1 But it seems there is some confusion what the test does... The Thus, there is no bug in the actual code, and because the test just passes always ever since it was added, the incorrect "test failed message" was never detected. I am happy to merge this PR as-is, as it does improve the test. But I want to point out, that it does not verify the actually error message from Just let me know how you want to proceed. |
Thank you @mjsax for the detailed explanation and feedback! After considering the test behavior, I believe adding validation for the exception message would significantly improve the test for the following reasons:
That said, I agree with you in proceeding with the PR as-is for now, as it already improves the test by fixing the misleading failure message. Once the community decides how to handle exception message validation, I’ll be happy to revisit the test and make any necessary updates to align with the agreed approach. Let me know your thoughts! |
The unit test
testInflightRequestsAndIdempotenceForIdempotentProducers
checks for configuration validation errors when instantiating a ProducerConfig with invalid properties. One of the assertions in this test is designed to validate the constraint that max.in.flight.requests.per.connection must be at most 5 when using a transactional producer. However, the error message thrown by the ProducerConfig constructor in this scenario is incorrect.Observed Behavior:
When max.in.flight.requests.per.connection is set to 6 for a transactional producer, the test expects an exception with the message:
"Must set max.in.flight.requests.per.connection to at most 5 when using the transactional producer."
Instead, the error message states:
"Must set retries to non-zero when using the idempotent producer."
Expected Behavior:
The error message should explicitly indicate the violation of the max.in.flight.requests.per.connection constraint for transactional producers:
"Must set max.in.flight.requests.per.connection to at most 5 when using the transactional producer."
The mismatch in the error message can lead to confusion for developers debugging the configuration error, as it incorrectly hints at a retries configuration issue instead of the actual max.in.flight.requests.per.connection issue.
Note: the contribution is my original work and I license the work to the project under the project's open source license