cockroachdb / cockroachdb/cockroach
settings: better validation of values for protobuf settings
Open
branch-master
C-cleanup
T-db-server
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Currently, `ProtobufSetting.String()` panics if `MarshalToJSON` fails. This could in principle fail for various reasons, like required fields not being set.
One solution would be marshaling the default when we register the setting, and also when we set a new value. We could just hold on to the marshaled string so the `String() / DefaultString()` functions are trivial.
Jira issue: CRDB-39556
Contributor guide
Assessment
This issue has not been assessed yet.