AndrewJSchofield commented on code in PR #14111: URL: https://github.com/apache/kafka/pull/14111#discussion_r1295030179
########## clients/src/main/java/org/apache/kafka/clients/Metadata.java: ########## @@ -140,17 +172,34 @@ public long metadataExpireMs() { } /** - * Request an update of the current cluster metadata info, return the current updateVersion before the update + * Request an update of the current cluster metadata info, permitting backoff based on the number of + * equivalent metadata responses, which indicates that responses did not make progress and may be stale. + * @param permitBackoffOnEquivalentResponses Whether to permit backoff when consecutive responses are equivalent. + * This should be set to <i>true</i> in situations where the update is + * being requested to retry an operation, such as when the leader has + * changed. It should be set to <i>false</i> in situations where new + * metadata is being requested, such as adding a topic to a subscription. + * In situations where it's not clear, it's best to use <i>false</i>. + * @return The current updateVersion before the update */ - public synchronized int requestUpdate() { + public synchronized int requestUpdate(final boolean permitBackoffOnEquivalentResponses) { this.needFullUpdate = true; + if (!permitBackoffOnEquivalentResponses) { Review Comment: I think the negation is a little clearer. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org