d5d0c442ac
In satellite/accounting/rollup Service.RollupStorage we have a few potential error scenarios that return time.Now(). Especially in the case where we exit early because we have received 0 tallies since the *last* rollup, this creates a potential race condition. Between the time we call GetTalliesSince and realize it is empty, it's possible a tally was inserted in that interval. As currently written we are returning a latestTally time that excludes that tally. We are currently protected because in Service.Rollup we don't save the rollup unless we have populated the rollupStats. However, this change is more correct and future-proof, because Service.RollupStorage should always return a correct latestTally time, which in case of errors and empty tallies, is the last successful tally. Change-Id: I2521a2cc9802c8f06e512dde4422803a272e2a0a |
||
---|---|---|
.. | ||
common.go | ||
rollup_test.go | ||
rollup.go |