cockroachdb / cockroachdb/cockroach

settings: audit and prevent races on change

Open
#128,684 1 comment 0 reactions 0 assignees View on GitHub
A-kv branch-master C-bug P-3 T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

@pav-kv [discovered](https://cockroachlabs.slack.com/archives/G01G8LK77DK/p1723161001811399) possibility for races between registering an `SetOnChange ` callback and initially storing the setting value in memory (https://github.com/cockroachdb/cockroach/pull/128217):

e.g.

```
thing := initThing(important.Setting.Get(&settings.SV))
// do stuff
important.Setting.SetOnChange(&settings.SV, thing.updateSetting)
```

This issue is to audit and prevent races of this type.

Jira issue: CRDB-41147

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.