gr-m-9 commented on code in PR #13490: URL: https://github.com/apache/kafka/pull/13490#discussion_r1212990392
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/PrototypeAsyncConsumer.java: ########## @@ -447,6 +482,19 @@ public void close() { @Override public void close(Duration timeout) { + if (timeout.toMillis() < 0) + throw new IllegalArgumentException("The timeout cannot be negative."); + try { + if (!closed) { + close(timeout, false); + } + } finally { + closed = true; Review Comment: could you explain why closed is boolean but shouldWakeup is AtomicBoolean ? ########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/PrototypeAsyncConsumer.java: ########## @@ -114,14 +119,14 @@ public PrototypeAsyncConsumer(final ConsumerConfig config, final Deserializer<V> valueDeserializer) { this.time = Time.SYSTEM; GroupRebalanceConfig groupRebalanceConfig = new GroupRebalanceConfig(config, - GroupRebalanceConfig.ProtocolType.CONSUMER); + GroupRebalanceConfig.ProtocolType.CONSUMER); this.groupId = Optional.ofNullable(groupRebalanceConfig.groupId); this.clientId = config.getString(CommonClientConfigs.CLIENT_ID_CONFIG); this.defaultApiTimeoutMs = config.getInt(ConsumerConfig.DEFAULT_API_TIMEOUT_MS_CONFIG); // If group.instance.id is set, we will append it to the log context. if (groupRebalanceConfig.groupInstanceId.isPresent()) { logContext = new LogContext("[Consumer instanceId=" + groupRebalanceConfig.groupInstanceId.get() + - ", clientId=" + clientId + ", groupId=" + groupId.orElse("null") + "] "); + ", clientId=" + clientId + ", groupId=" + groupId.orElse("null") + "] "); Review Comment: creation such of instances shall be done in separate methods -- 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