C0urante commented on a change in pull request #11524: URL: https://github.com/apache/kafka/pull/11524#discussion_r754530063
########## File path: connect/runtime/src/main/java/org/apache/kafka/connect/runtime/SubmittedRecords.java ########## @@ -132,6 +144,27 @@ public CommittableOffsets committableOffsets() { return new CommittableOffsets(offsets, totalCommittableMessages, totalUncommittableMessages, records.size(), largestDequeSize, largestDequePartition); } + /** + * Wait for all currently in-flight messages to be acknowledged, up to the requested timeout. + * @param timeout the maximum time to wait + * @param timeUnit the time unit of the timeout argument + * @return whether all in-flight messages were acknowledged before the timeout elapsed + */ + public boolean awaitAllMessages(long timeout, TimeUnit timeUnit) { Review comment: This method should only be called once at a time, and some pretty nasty things can happen if that doesn't happen (all but the last invocation of it may hang forever since the countdown latch that each such invocation waits on would never be counted down). I chose not to document this because the class is already documented as not being thread-safe in the class-level Javadoc. -- 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