shashankhs11 commented on code in PR #20285:
URL: https://github.com/apache/kafka/pull/20285#discussion_r2418437509
##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/ProduceRequestResult.java:
##########
@@ -129,6 +148,17 @@ public TopicPartition topicPartition() {
* Has the request completed?
*/
public boolean completed() {
- return this.latch.getCount() == 0L;
+ if (this.latch.getCount() != 0L) {
+ return false;
+ }
+ // are all the dependent results completed?
+ synchronized (dependentResults) {
Review Comment:
@junrao I have a doubt regarding our test expectations:
> verify originalBatch.produceFuture.completed() returns false
This would then return `true`, right? Because `completed()` now would only
check the latch which is released when the split occurs. So, we would then need
to verify:
- `originalBatch.produceFuture.completed()` is `true`
- `future1.isDone()` is `false`
- `future2.isDone()` is `false`
So, we're testing that individual futures wait for their split batches (via
chaining), not that the original batch's `completed()` waits for dependents.
Is my understanding correct?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]