Files
nomad/.changelog/23673.txt
Tim Gross 92d216f3b8 scaling: fix state store corruption bug for job scaling events (#23673)
When updating a `JobScalingEvent`, the state store function did not copy the
existing object before mutating it. This corrupts the state store because it
modifies the leaf node without committing it in a transaction. It can also cause
the Nomad server to crash with a "fatal error: concurrent map read and map
write" if its `ScalingEvents` map is read via the `ScaleStatus` RPC at the same
time as it's being written.

This changeset also removes some mostly-unused public methods on the struct that
dangerously encourage you to mutate it outside of a copy.

Ref: https://hashicorp.atlassian.net/browse/NET-10529
2024-07-24 09:18:03 -04:00

4 lines
114 B
Plaintext

```release-note:bug
scaling: Fixed a bug where state store corruption could occur when writing scaling events
```