Browse Source

AMBARI-345. Make TxnProgressWidget More Robust In The Face Of Un-Ready Txn Stages (Contributed by Varun)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1346633 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K 13 years ago
parent
commit
cb467e0a32
2 changed files with 10 additions and 1 deletions
  1. 2 0
      CHANGES.txt
  2. 8 1
      hmc/php/frontend/fetchTxnProgress.php

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-345. Make TxnProgressWidget More Robust In The Face Of Un-Ready Txn Stages (Varun via Vikram)
+
   AMBARI-346. user should not be allowed to change the paths to various directories on the advance config page (Hitesh via Vikram)
 
   AMBARI-316. Grid mount points page doesn't let one pass with only a custom mount point (Vinod via Vikram)

+ 8 - 1
hmc/php/frontend/fetchTxnProgress.php

@@ -688,6 +688,13 @@ foreach( $progress['subTxns'] as &$progressSubTxn )
 
 $lastTransaction = $progressSubTxn;
 
+/* If at least one subTxn isn't in progress, signal to the frontend that 
+ * there's nothing worthy for it to process yet. 
+ */
+if (!$atLeastOneSubTxnInProgress) {
+  $progress['subTxns'] = null;
+}
+
 $dbAccessor = new HMCDBAccessor($GLOBALS["DB_PATH"]);
 
 if (($progress['processRunning'] == FALSE) || ($progress['encounteredError'] == TRUE)) {
@@ -718,7 +725,7 @@ unset( $progress['error'] );
 $jsonOutput = array(
     'clusterName' => $clusterName,
     'txnId' => $txnId,
-    'progress' => $atLeastOneSubTxnInProgress ? $progress : null );
+    'progress' => $progress );
 
 if ($deployUser != null) {
     $jsonOutput['deployUser'] = $deployUser;