-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Open
Labels
P3no SLOno SLOpackage=cachetype=defectBug, not working as expectedBug, not working as expectedtype=documentationDocumentation that is other than for an APIDocumentation that is other than for an API
Description
While using the SimpleStatsCounter class in the com.google.common.cache package, we found that it is not thread-safe as documented. As a simple example, we can have one thread invoking recordLoadSuccess with a non-zero value. It executes loadSuccessCount.increment() and before it can execute totalLoadTime.add(loadTime), if another threads calls a snapshot on the cache, it will return an inconsistent state (where the successCount and loadtime are inconsistent).
Should the methods be synchronized in this class? If not, may be the documentation can be fixed to remove claims on thread-safety?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3no SLOno SLOpackage=cachetype=defectBug, not working as expectedBug, not working as expectedtype=documentationDocumentation that is other than for an APIDocumentation that is other than for an API