Skip to content

Commit f4fc788

Browse files
committed
Adding spotbugs suppression
The racy updates of cache stat fields is deliberate -- and that's the cause of the inconsistent sync-ing
1 parent 890133b commit f4fc788

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/GenerationalUtf8Cache.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import datadog.communication.serialization.EncodingCache;
44
import datadog.trace.common.writer.ddagent.SimpleUtf8Cache.CacheEntry;
5+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
6+
57
import java.nio.charset.StandardCharsets;
68

79
/**
@@ -63,6 +65,9 @@
6365
* calling ValueUtf8Cache#reclibrate will adjust promotion thresholds to
6466
* provide better cache utilization.
6567
*/
68+
@SuppressFBWarnings(
69+
value="IS2_INCONSISTENT_SYNC",
70+
justification="stat updates are deliberately racy - sync is only used to prevent simultaneous bulk updates")
6671
public final class GenerationalUtf8Cache implements EncodingCache {
6772
static final int MAX_EDEN_CAPACITY = 512;
6873
static final int MAX_TENURED_CAPACITY = 1024;

0 commit comments

Comments
 (0)