chia7712 commented on code in PR #20650:
URL: https://github.com/apache/kafka/pull/20650#discussion_r2414632130


##########
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java:
##########
@@ -1635,8 +1635,9 @@ public synchronized boolean close(final CloseOptions 
options) throws IllegalArgu
     public synchronized boolean close(final 
org.apache.kafka.streams.CloseOptions options) throws IllegalArgumentException {
         Objects.requireNonNull(options, "options cannot be null");
         final CloseOptionsInternal optionsInternal = new 
CloseOptionsInternal(options);
-        final String msgPrefix = 
prepareMillisCheckFailMsgPrefix(optionsInternal.timeout(), "timeout");
-        final long timeoutMs = 
validateMillisecondDuration(optionsInternal.timeout().get(), msgPrefix);
+        final Duration timeout = 
optionsInternal.timeout().orElse(Duration.ofMillis(Long.MAX_VALUE));

Review Comment:
   Perhaps using `orElseGet` is more better, which can avoid creating `Duration`



-- 
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]

Reply via email to