lianetm commented on code in PR #21080:
URL: https://github.com/apache/kafka/pull/21080#discussion_r3581457215
##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/consumer/PlaintextConsumerCommitTest.java:
##########
@@ -290,6 +290,12 @@ private void testAsyncCommit(GroupProtocol groupProtocol)
throws InterruptedExce
try (var consumer = createConsumer(groupProtocol, false)) {
consumer.assign(List.of(tp));
+ // Warm up: force bootstrap DNS resolution and group coordinator
discovery before
+ // issuing async commits. Without this, KIP-909's deferred
bootstrap can push
+ // coordinator discovery past the first commitAsync attempt,
yielding a
+ // RetriableCommitFailedException that this test does not tolerate.
+ consumer.commitSync(Map.of(tp, new OffsetAndMetadata(0L)));
Review Comment:
Interesting. I do get the situation and the need for the pre-warm. But then
it makes me wonder, is there a reason why we have to wait for the first call to
poll to trigger the async resolution?? vs triggering it early when the client
is created? (we know the result is needed anyways and that it may take time to
resolve).
Meaning we could trigger an async resolution when the network client is
created (no time-boundary or check here, it just an early trigger to get
ahead). Then poll remains the main driver of the bootstrap process as it is
now: it is the one checking the result, enforcing the timer, propagating errors
if any, retrying etc. Only the trigger moves to an earlier point in time
(constructor)
Even with that we may still have the situation this test shows (delayed DNS
resolution), but just wondering if it's worth/doable to avoid the delay we are
introducing ourselves compared to how it was before.
Makes sense or am I missing something ? We can address as an improvement in
a follow-up if we think it makes sense
--
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]