You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ea...@apache.org on 2019/02/01 18:05:38 UTC

[qpid-dispatch] branch master updated: DISPATCH-1260 Discard any pending requests when traffic animation is stopped

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

eallen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
     new 37e81fb  DISPATCH-1260 Discard any pending requests when traffic animation is stopped
37e81fb is described below

commit 37e81fb68b1772514791d1645556abc72da2f935
Author: Ernest Allen <ea...@redhat.com>
AuthorDate: Fri Feb 1 13:05:18 2019 -0500

    DISPATCH-1260 Discard any pending requests when traffic animation is stopped
---
 console/stand-alone/plugin/js/topology/traffic.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/console/stand-alone/plugin/js/topology/traffic.js b/console/stand-alone/plugin/js/topology/traffic.js
index e192374..522b0c2 100644
--- a/console/stand-alone/plugin/js/topology/traffic.js
+++ b/console/stand-alone/plugin/js/topology/traffic.js
@@ -133,6 +133,7 @@ class Congestion extends TrafficAnimation {
   constructor(traffic) {
     super(traffic);
     this.type = "congestion";
+    this.stopped = false;
     this.init_markerDef();
   }
   init_markerDef() {
@@ -161,6 +162,7 @@ class Congestion extends TrafficAnimation {
     return null;
   }
   doUpdate() {
+    this.stopped = false;
     let self = this;
     this.traffic.QDRService.management.topology.ensureAllEntities(
       [{
@@ -170,6 +172,9 @@ class Congestion extends TrafficAnimation {
         entity: "connection"
       }],
       function () {
+        // animation was stopped between the ensureAllEntities request and the response
+        if (self.stopped)
+          return;
         let links = {};
         let nodeInfo = self.traffic.QDRService.management.topology.nodeInfo();
         const nodes = self.traffic.topology.nodes.nodes;
@@ -304,6 +309,7 @@ class Congestion extends TrafficAnimation {
     return color(Math.max(0, Math.min(3, v)));
   }
   remove() {
+    this.stopped = true;
     d3.select("#SVG_ID")
       .selectAll("path.traffic")
       .classed("traffic", false);
@@ -416,6 +422,9 @@ class Dots extends TrafficAnimation {
         attrs: ["id", "nextHop"]
       }],
       function () {
+        // if we were stopped between the request and response, just exit
+        if (self.stopped)
+          return;
         // get the ingressHistogram data for all routers
         self.chordData.getMatrix().then(self.render.bind(self), function (e) {
           console.log("Could not get message histogram" + e);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org