squah-confluent commented on code in PR #21627:
URL: https://github.com/apache/kafka/pull/21627#discussion_r2896021359
##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupConfig.java:
##########
@@ -93,6 +113,10 @@ public final class GroupConfig extends AbstractConfig {
public final String shareAutoOffsetReset;
+ public final int shareAssignmentIntervalMs;
+
+ public final Optional<Boolean> shareAssignorOffloadEnable;
Review Comment:
I would much prefer to default to `null` and not allow `-1`. However there's
no precedent for having a default of `null` for integer or boolean configs
anywhere.
If I set the default for the `assignment.interval.ms` configs to `null`, I
get a startup error.
```
Caused by:
java.lang.ExceptionInInitializerError: Exception
org.apache.kafka.common.config.ConfigException: Invalid value null for
configuration consumer.assignment.interval.ms: Value must be non-null [in
thread "Test worker"]
at
org.apache.kafka.common.config.ConfigDef$Range.ensureValid(ConfigDef.java:1008)
at
org.apache.kafka.common.config.ConfigDef$ConfigKey.<init>(ConfigDef.java:1342)
at
org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:158)
at
org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:201)
at
org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:240)
at
org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:402)
at
org.apache.kafka.coordinator.group.GroupConfig.<clinit>(GroupConfig.java:144)
```
If I instead set the default to `ConfigDef.NO_DEFAULT_VALUE`, I get a
different error.
```
org.apache.kafka.common.config.ConfigException: Missing required
configuration "consumer.assignment.interval.ms" which has no default value.
```
So to make `null` work for those configs, we would have to define an
`Optional.of` validator or `Null` and `Any.of` validators . Do you think it's
worth doing?
--
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]