mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
1c7064c066
connMetrics.total was written to via atomic.AddInt64 and read as a plain int64, producing a data race. Fix by switching the field to atomic.Int64 and using its typed Add/Load methods. The testMetrics mock had a similar issue where mutex use was missing where GetTotalBytes read the total bytes, which is also fixed in this change.