cockroachdb / cockroachdb/cockroach

settings: better validation of values for protobuf settings

Open
#125,685 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.