From commits-return-19613-archive-asf-public=cust-asf.ponee.io@pulsar.apache.org Wed Dec 26 06:34:25 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C75AF180677 for ; Wed, 26 Dec 2018 06:34:24 +0100 (CET) Received: (qmail 7780 invoked by uid 500); 26 Dec 2018 05:34:23 -0000 Mailing-List: contact commits-help@pulsar.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pulsar.apache.org Delivered-To: mailing list commits@pulsar.apache.org Received: (qmail 7771 invoked by uid 99); 26 Dec 2018 05:34:23 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Dec 2018 05:34:23 +0000 From: GitBox To: commits@pulsar.apache.org Subject: [GitHub] sijie closed pull request #3250: Clear-out old inbound cnx stats when repl producer disconnects Message-ID: <154580246331.15118.4480189647745305899.gitbox@gitbox.apache.org> Date: Wed, 26 Dec 2018 05:34:23 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit sijie closed pull request #3250: Clear-out old inbound cnx stats when repl producer disconnects URL: https://github.com/apache/pulsar/pull/3250 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java index cc73d0c7d0..77bd3ec073 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java @@ -1211,12 +1211,10 @@ public void updateRates(NamespaceStats nsStats, NamespaceBundleStats bundleStats // Add incoming msg rates PublisherStats pubStats = topicStatsHelper.remotePublishersStats.get(replicator.getRemoteCluster()); - if (pubStats != null) { - rStat.msgRateIn = pubStats.msgRateIn; - rStat.msgThroughputIn = pubStats.msgThroughputIn; - rStat.inboundConnection = pubStats.getAddress(); - rStat.inboundConnectedSince = pubStats.getConnectedSince(); - } + rStat.msgRateIn = pubStats != null ? pubStats.msgRateIn : 0; + rStat.msgThroughputIn = pubStats != null ? pubStats.msgThroughputIn : 0; + rStat.inboundConnection = pubStats != null ? pubStats.getAddress() : null; + rStat.inboundConnectedSince = pubStats != null ? pubStats.getConnectedSince() : null; topicStatsHelper.aggMsgRateOut += rStat.msgRateOut; topicStatsHelper.aggMsgThroughputOut += rStat.msgThroughputOut; ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services