You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by ra...@apache.org on 2016/10/19 10:11:02 UTC
incubator-eagle git commit: EAGLE-641: Publishment reload may
introduce NPE
Repository: incubator-eagle
Updated Branches:
refs/heads/master c45ac6d57 -> 44259aeca
EAGLE-641: Publishment reload may introduce NPE
The publishment initialization may have problem which will cause reload NPE.
Author: Li, Garrett
Reviewer: ralphsu
This closes #534
Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/44259aec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/44259aec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/44259aec
Branch: refs/heads/master
Commit: 44259aeca48554b9ee60d127cbc4d39649067943
Parents: c45ac6d
Author: Xiancheng Li <xi...@ebay.com>
Authored: Wed Oct 19 02:53:35 2016 -0700
Committer: Ralph, Su <su...@gmail.com>
Committed: Wed Oct 19 18:02:06 2016 +0800
----------------------------------------------------------------------
.../eagle/alert/engine/publisher/impl/AlertKafkaPublisher.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/44259aec/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertKafkaPublisher.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertKafkaPublisher.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertKafkaPublisher.java
index 5df34e3..e9c0c70 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertKafkaPublisher.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertKafkaPublisher.java
@@ -75,7 +75,9 @@ public class AlertKafkaPublisher extends AbstractPublishPlugin {
String newBrokerList = pluginProperties.get(PublishConstants.BROKER_LIST).trim();
String newTopic = pluginProperties.get(PublishConstants.TOPIC).trim();
if (!newBrokerList.equals(this.brokerList)) {
- producer.close();
+ if (producer != null) {
+ producer.close();
+ }
brokerList = newBrokerList;
KafkaProducer newProducer = null;
try {