Skip to content

Commit

Permalink
Wrap metrics() in sychronized block to try and prevent CME
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffxiang committed Dec 13, 2024
1 parent 70d83e2 commit 30a5b22
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,9 @@ public Map<MetricName, Metric> metrics() throws ClientException {
ensureOpen();
Map<MetricName, Metric> metrics = new ConcurrentHashMap<>();
for (PscBackendConsumer<K, V> backendConsumer : backendConsumers) {
metrics.putAll(backendConsumer.metrics());
synchronized (backendConsumer.metrics()) {
metrics.putAll(backendConsumer.metrics());
}
}
return metrics;
}
Expand Down

0 comments on commit 30a5b22

Please sign in to comment.