-
Notifications
You must be signed in to change notification settings - Fork 141
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
Alternative producer implementation #1285
Conversation
Refactoring of the producer so that it handles errors per record.
(metadata: RecordMetadata, err: Exception) => | ||
unsafeRun { | ||
if (err == null) done.succeed(metadata) | ||
else done.fail(err) |
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.
if we change this to done.fail((record,err))
we could implement a retry strategy in 494
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.
I like the idea. But are you sure you want to do the retries record by record?
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.
I think that is the only way to not send messages again that have been previously accepted, e.g. prevent double delivery?
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.
The other option is to do something after line 489. There you can records.zip(results)
and filter those that failed. The failed records can then be retried together. The challenge is mostly to write elegant code that merges the original results with the retry results.
Refactoring of the producer so that it handles errors per record.
This reverts commit fd40816.
During running services with the new version of library 2.8.1, I noticed huge increase in messages production time to kafka. Some quick rough tests shoving me around 40x-100x times increase in amount of time taken to `produceChunk` on even 1-10 records chunks comparing to version 2.8.0 (or also to version 2.8.1 with the changes in this MR). Please, note, it is not a proper benchmarks. Also, to note, Im using Scala version 3.3.1. This MR just reverts two MRs updating `ProducersendFromQueue` implementation: - #1272 - #1285 Not sure if it's possible to revert two MRs at a time (with a single one for revert), so created this one. I haven't researched yet which exact change/changes are causing such performance degradation. I would suggest the next steps: - confirm the problem exists - reverting to the previous implementation (the one from 2.8.0/this MR) - release fixed version (to allow users have a nicely working version) - investigate & fix problem from the #1272 and/or #1285 It is only suggestions on the approach, feel free to ignore them. Also, feel free to modify/ignore this MR and treat it as an issue.
Refactoring of the producer so that it handles errors per record. These changes were part of 2.8.1 (via #1285 and #1272) but were reverted in 2.8.2 (via #1304) after reports of performance regression. This is a retry to make it easier to run the benchmarks and make further improvements. This reverts commit 3393fbf.
Refactoring of the producer so that it handles errors per record. These changes were part of 2.8.1 (via #1285 and #1272) but were reverted in 2.8.2 (via #1304) after reports of performance regression. This is a retry to make it easier to run the benchmarks and make further improvements. This reverts commit 3393fbf.
Refactoring of the producer so that it handles errors per record. These changes were part of 2.8.1 (via #1285 and #1272) but were reverted in 2.8.2 (via #1304) after reports of performance regression. This is a retry to make it easier to run the benchmarks and make further improvements. This reverts commit 3393fbf.
Refactoring of the producer so that it handles errors per record. These changes were part of 2.8.1 (via #1285 and #1272) but were reverted in 2.8.2 (via #1304) after reports of performance regression. This is a retry to make it easier to run the benchmarks and make further improvements. This reverts commit 3393fbf.
Refactoring of the producer so that it handles errors per record.