Skip to content

Commit 2dcaf0e

Browse files
authored
[fix][broker] Fix the loss of bundle stats data reported to zookeeper, when the updateStats method is executed (#19887)
Co-authored-by: lordcheng10 <lordcheng1020@gmail.com>
1 parent be57e9a commit 2dcaf0e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarStats.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public synchronized void updateStats(
233233
updatedAt = System.currentTimeMillis();
234234
}
235235

236-
public NamespaceBundleStats invalidBundleStats(String bundleName) {
236+
public synchronized NamespaceBundleStats invalidBundleStats(String bundleName) {
237237
return bundleStats.remove(bundleName);
238238
}
239239

@@ -254,7 +254,7 @@ public BrokerOperabilityMetrics getBrokerOperabilityMetrics() {
254254
return brokerOperabilityMetrics;
255255
}
256256

257-
public Map<String, NamespaceBundleStats> getBundleStats() {
257+
public synchronized Map<String, NamespaceBundleStats> getBundleStats() {
258258
return bundleStats;
259259
}
260260

0 commit comments

Comments
 (0)