awslabs / tough

Rust libraries and tools for using and generating TUF repositories

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Datastore: `system_time` should be a critical section

ecpullen opened this issue · comments

The current implementation of Datastore and system_time are open to several race conditions when reading targets from many threads. To ensure that each timestamp written to latest_known_time.json is read, the entire process of calculating and writing the latest known time should be completed under a RwLock on the datastore.