mirror of https://github.com/tailscale/tailscale/
ipn/store: improve FileStore.WriteState atomicity
If an error occurs with FileStore.WriteState, it should not record the provided value as this results in an inconsistency between what is cached in memory and what is stored on disk. Also, update the documentation of StateStore.ReadState to indicate that the returned value should be treated as immutable. This property is assumed by the fact that FileStore.ReadState returns the same slice of bytes for repeated calls to the same key. Updates #cleanup Signed-off-by: Joe Tsai <joetsai@digital-static.net>dsnet/statestore
parent
60e768fd14
commit
2ad040db3b
Loading…
Reference in New Issue