3 ms·
> The first time it's seen in any environment, it thread-safely inserts-if-not-present the default value into a key-value storage That seems like a great way t
by masklinn 4y ago
> The first time it's seen in any environment, it thread-safely inserts-if-not-present the default value into a key-value storage
That seems like a great way to get amazingly hard to replicate bugs or odd behaviours if different subsystems use different values for the default.
- elcritch 4y agoYou'd just need to have a mutex lock on the values. That could be slow, but you probably don't want to have a config flag in a hot loop anyways. :) In Nim you can do compile flags which let you set constants so you avoid the problem: const myLibraryVersion {.intdefine.} = 3
- masklinn 4y ago> You'd just need to have a mutex lock on the values. Oh no they're saying that it's thread-safe, that's not an issue. Rather that depending on the order of initialisation, possibly of different systems entirely, you can have different initial states because different systems or subsystem decided of the default value.
- philsnow 4y agoI would want that system to log those changes to whatever monitoring system is being used, or integrate with the deployment system as a "deploy", so that when some oncall person is trying to figure out why the entire fleet is pegging their CPU, they can trace it back to the flag change.