You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lo...@apache.org on 2023/04/03 04:55:23 UTC

[pulsar] branch master updated: [fix][broker] Fix the loss of bundle stats data reported to zookeeper, when the updateStats method is executed (#19887)

This is an automated email from the ASF dual-hosted git repository.

lordcheng10 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 2dcaf0ef692 [fix][broker] Fix the loss of bundle stats data reported to zookeeper, when the updateStats method is executed (#19887)
2dcaf0ef692 is described below

commit 2dcaf0ef692c929ebf6c510d328e0f2775f07f3e
Author: LinChen <lo...@gmail.com>
AuthorDate: Mon Apr 3 12:55:16 2023 +0800

    [fix][broker] Fix the loss of bundle stats data reported to zookeeper, when the updateStats method is executed (#19887)
    
    Co-authored-by: lordcheng10 <lo...@gmail.com>
---
 .../src/main/java/org/apache/pulsar/broker/service/PulsarStats.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarStats.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarStats.java
index 9cdf9d1dfc6..2059aa04350 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarStats.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PulsarStats.java
@@ -233,7 +233,7 @@ public class PulsarStats implements Closeable {
         updatedAt = System.currentTimeMillis();
     }
 
-    public NamespaceBundleStats invalidBundleStats(String bundleName) {
+    public synchronized NamespaceBundleStats invalidBundleStats(String bundleName) {
         return bundleStats.remove(bundleName);
     }
 
@@ -254,7 +254,7 @@ public class PulsarStats implements Closeable {
         return brokerOperabilityMetrics;
     }
 
-    public Map<String, NamespaceBundleStats> getBundleStats() {
+    public synchronized Map<String, NamespaceBundleStats> getBundleStats() {
         return bundleStats;
     }