Check how to set a configuration value to null via env variables
Currently, it is not clear how one can set a nullable configuration value to null via env variables. See https://github.com/restatedev/restate/pull/467 for more details.
Seems like this is an upstream bug https://github.com/SergioBenitez/Figment/issues/78. I have posted a patch there, if the mantainer doesn't like it we can apply it only downstream
I think we can solve the problem by using #[serde_as(as = "serde_with::NoneAsEmptyString")] for Option<T> fields. Then one can set the field to None by specifying an empty string value.
@AhmedSoliman any chance you tried to do this with the new configurations?
What are we trying to achieve here? We shouldn't have configuration keys where null is a valid value, at least, that's true in the new configuration. TOML doesn't support nulls to start with.
The only way to use the default value is to "not set" it from env or config file, then the default will apply, but you can't "unset" from higher layers, effectively.
@AhmedSoliman is it possible to "unset" a default value that is set? The example in question was the num_timers_in_memory_limit used by the timer service, which by default is set but one might also want to unset it.