guozhangwang commented on a change in pull request #11868: URL: https://github.com/apache/kafka/pull/11868#discussion_r823308917
########## File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/namedtopology/KafkaStreamsNamedTopologyWrapper.java ########## @@ -266,46 +266,57 @@ private boolean maybeCompleteFutureIfStillInCREATED(final KafkaFutureImpl<Void> private RemoveNamedTopologyResult resetOffsets(final KafkaFutureImpl<Void> removeTopologyFuture, final Set<TopicPartition> partitionsToReset) { - if (!partitionsToReset.isEmpty()) { - removeTopologyFuture.whenComplete((v, throwable) -> { - if (throwable != null) { - removeTopologyFuture.completeExceptionally(throwable); - } - DeleteConsumerGroupOffsetsResult deleteOffsetsResult = null; - while (deleteOffsetsResult == null) { - try { - deleteOffsetsResult = adminClient.deleteConsumerGroupOffsets( - applicationConfigs.getString(StreamsConfig.APPLICATION_ID_CONFIG), partitionsToReset); - deleteOffsetsResult.all().get(); - } catch (final InterruptedException ex) { - ex.printStackTrace(); + final KafkaFutureImpl<Void> resetOffsetsFuture = new KafkaFutureImpl<>(); + try { + removeTopologyFuture.get(); Review comment: Got it, that makes a lot of sense, thanks! -- 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