check / check (push) Waiting to run
The dashboard and /api/v1/status range over the maps in the snapshot GetSnapshot returns after the read lock is released, while the watcher writes the same maps under the lock. Go aborts the process when a write lands during such a range. GetSnapshot now returns copies of the four maps. The entries in the maps are still shared with the state. That is safe because the watcher replaces an entry with a Set call and never changes one in place; the comment on GetSnapshot says so. TestGetSnapshot_WhileWritten ranges over snapshots while another goroutine writes the state and fails under -race without the copies. TestGetSnapshot_ReturnsCopy now checks that each map is not the state's own. Model: opus-5-5