cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.95k stars 3.79k forks source link

settings: better validation of values for protobuf settings #125685

Open RaduBerinde opened 3 months ago

RaduBerinde commented 3 months ago

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

blathers-crl[bot] commented 3 months ago

Hi @RaduBerinde, please add branch-* labels to identify which branch(es) this C-bug affects.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.