strongloop / strong-arc

StrongLoop Arc has been replaced by API Connect. We recommend Arc users move to the Essentials edition of API Connect. If you have questions, please email reachsl@us.ibm.com.
http://strongloop.com/
Other
115 stars 36 forks source link

tracing: compare recent setSize with recent Procs #1569

Closed sam-github closed 9 years ago

sam-github commented 9 years ago

Is not safe to assume setSize is constant while polling the processes.

sam-github commented 9 years ago

Replaces https://github.com/strongloop/strong-arc/pull/1566

@seanbrookes I didn't want to overwrite your PR, it might mess you up, but I rebased it and rewrote the commit message to reflect current behaviour.

This PR is completely identical to #1566, except for this difference:

diff --git a/client/www/scripts/modules/tracing/tracing.controllers.js b/client/www/scripts/modules/tracing/tracing.controllers.js
index b474b21..e9349e5 100644
--- a/client/www/scripts/modules/tracing/tracing.controllers.js
+++ b/client/www/scripts/modules/tracing/tracing.controllers.js
@@ -248,12 +248,12 @@ Tracing.controller('TracingMainController', [
               $log.warn('bad pm reload', err);
               return;
             }
-            var targetProcessCount = instance.setSize;
-            if (targetProcessCount > 0) {
+            $scope.targetProcessCount = instance.setSize;
+            if ($scope.targetProcessCount > 0) {
               $scope.startTicker();
               // processes are still coming up
               var fpLen = filteredProcesses.length;
-              if (fpLen !== targetProcessCount) {
+              if (fpLen !== $scope.targetProcessCount) {
                 if (!restarting) {
                   if (prevTracingPidCount !== fpLen) {
                     // show progress via growl each time the process count changes

This fixes a bug where the progress string "X of N process restarted" (or somesuch) has the wrong N value if it is changed while the cluster is restarting. It does this by updating the global var to always be as current as possible.

I suggest merging this, and closing #1566.

sam-github commented 9 years ago

Closing, sean pulled the changes into his branch.