Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(subscriber): use saturating arithmetic for attribute updates (#234)
Currently, an issue exists where a subtraction attribute update for a resource or async op attribute may overflow, if a previous add update was dropped due to event buffer capacity. This may result in the aggregator task panicking. See #180 (comment) for details. This branch changes all resource updates to use saturating arithmetic. In practice, I think it's _much_ more likely for a subtract to overflow due to missed adds than it is for an add to overflow due to missed subs, but I made the addition saturating as well, just in case. We should probably also increase the default event buffer capacity, since it seems like lots of people are hitting problems with this...
- Loading branch information