chia7712 commented on code in PR #20650:
URL: https://github.com/apache/kafka/pull/20650#discussion_r2410776459
##########
streams/src/main/java/org/apache/kafka/streams/CloseOptions.java:
##########
@@ -81,7 +81,11 @@ public static CloseOptions groupMembershipOperation(final
GroupMembershipOperati
* @return this {@code CloseOptions} instance.
*/
public CloseOptions withTimeout(final Duration timeout) {
- this.timeout = Optional.ofNullable(timeout);
+ if (timeout == null) {
+ this.timeout = Optional.of(Duration.ofMillis(Long.MAX_VALUE));
Review Comment:
It looks like `timeout` is never `empty`. However, I think keeping the
`empty` state is useful because it shows the user did not explicitly set a
`timeout`. Maybe we can use `orElse` to address the comments
```java
var timeout =
optionsInternal.timeout().orElse(Duration.ofMillis(Long.MAX_VALUE));
final String msgPrefix = prepareMillisCheckFailMsgPrefix(timeout,
"timeout");
final long timeoutMs = validateMillisecondDuration(timeout,
msgPrefix);
```
--
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]