Repository: tez Updated Branches: refs/heads/branch-0.7 b725d0b34 -> c7a946c9c
TEZ-2843. Tez UI: Show error if in progress fails due to AM not reachable (pramachandran) (cherry picked from commit f1ab3c38a66323962d41500e97cf0b34cdd4df55) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/c7a946c9 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/c7a946c9 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/c7a946c9 Branch: refs/heads/branch-0.7 Commit: c7a946c9ca5cc8f7ae16a0b020dc530e08157d5f Parents: b725d0b Author: Prakash Ramachandran <[email protected]> Authored: Tue Sep 22 15:44:29 2015 +0530 Committer: Prakash Ramachandran <[email protected]> Committed: Tue Sep 22 15:45:34 2015 +0530 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../main/webapp/app/scripts/controllers/dag_controller.js | 9 ++++++++- .../webapp/app/scripts/controllers/task_controller.js | 1 + .../webapp/app/scripts/controllers/vertex_controller.js | 2 ++ .../webapp/app/scripts/helpers/entity-array-pollster.js | 8 ++++++++ tez-ui/src/main/webapp/app/scripts/helpers/error-bar.js | 3 ++- .../main/webapp/app/scripts/mixins/model-refresh-mixin.js | 1 + tez-ui/src/main/webapp/app/templates/task/index.hbs | 10 ++++++---- .../src/main/webapp/app/templates/taskAttempt/index.hbs | 10 ++++++---- tez-ui/src/main/webapp/app/templates/vertex/index.hbs | 2 ++ 10 files changed, 37 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/c7a946c9/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 8512758..2b6204c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ Release 0.7.1: Unreleased INCOMPATIBLE CHANGES ALL CHANGES + TEZ-2843. Tez UI: Show error if in progress fails due to AM not reachable TEZ-2842. Tez UI: Update Tez App details page while in-progress TEZ-2834. Make Tez preemption resilient to incorrect free resource reported by YARN http://git-wip-us.apache.org/repos/asf/tez/blob/c7a946c9/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js index 334c72a..9643f64 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/dag_controller.js @@ -123,8 +123,14 @@ App.DagController = Em.ObjectController.extend(App.Helpers.DisplayHelper, { that.set('amDagInfo', dagInfo); //TODO: find another way to trigger notification that.set('amDagInfo._amInfoLastUpdatedTime', moment()); + that.set('amProgressInfoSucceededOnce', true); }).catch(function(e){ - // do nothing. + if (that.get('amProgressInfoSucceededOnce') === true) { + that.set('amProgressInfoSucceededOnce', false); + App.Helpers.ErrorBar.getInstance().show( + "Failed to get in-progress status. Manually refresh to get the updated status", + "Application Manager either exited or is not running."); + } }); }, @@ -189,6 +195,7 @@ App.DagController = Em.ObjectController.extend(App.Helpers.DisplayHelper, { // stop the update service if the status changes. see startAMInfoUpdateService stopAMInfoUpdateService: function() { + that.set('amProgressInfoSucceededOnce', false); if (this.get('loading') || this.get('model.status') != 'RUNNING') { this.dostopAMInfoUpdateService(); } http://git-wip-us.apache.org/repos/asf/tez/blob/c7a946c9/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js index 8893c87..9a4476c 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/task_controller.js @@ -81,6 +81,7 @@ App.TaskController = Em.ObjectController.extend(App.Helpers.DisplayHelper, App.M var vertexLoader = this.store.find('vertex', task.get('vertexID')); var tezAppLoader = this.store.find('tezApp', 'tez_' + applicationId); + task.set('progress', undefined); var allLoaders = Em.RSVP.hash({ dag: dagLoader, vertex: vertexLoader, http://git-wip-us.apache.org/repos/asf/tez/blob/c7a946c9/tez-ui/src/main/webapp/app/scripts/controllers/vertex_controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_controller.js index eeee1c9..4cc4797 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/vertex_controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/vertex_controller.js @@ -74,6 +74,8 @@ App.VertexController = Em.ObjectController.extend(App.Helpers.DisplayHelper, App that = this, applicationId = vertex.get('applicationId'); + vertex.set('progress', undefined); + // Irrespective of am version this will get the progress first. if (vertex.get('status') == 'RUNNING') { var vertexIdx = vertex.get('id').split('_').splice(-1).pop(); http://git-wip-us.apache.org/repos/asf/tez/blob/c7a946c9/tez-ui/src/main/webapp/app/scripts/helpers/entity-array-pollster.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/helpers/entity-array-pollster.js b/tez-ui/src/main/webapp/app/scripts/helpers/entity-array-pollster.js index 10e217f..d7f4aa4 100644 --- a/tez-ui/src/main/webapp/app/scripts/helpers/entity-array-pollster.js +++ b/tez-ui/src/main/webapp/app/scripts/helpers/entity-array-pollster.js @@ -46,6 +46,7 @@ App.Helpers.EntityArrayPollster = App.Helpers.Pollster.extend({ }, stop: function() { + this.set('amProgressInfoSucceededOnce', false); if(this.get('isRunning')) { Ember.run.cancel(this.get('timer')); this.set('isRunning', false); @@ -78,12 +79,19 @@ App.Helpers.EntityArrayPollster = App.Helpers.Pollster.extend({ }, onResponse: function (data) { + this.set('amProgressInfoSucceededOnce', true); this.set('polledRecords', data); this.mergeToTarget(); }, onFailure: function (err) { // Implement based on requirement + if (this.get('amProgressInfoSucceededOnce') === true) { + this.set('amProgressInfoSucceededOnce', false); + App.Helpers.ErrorBar.getInstance().show( + "Failed to get in-progress status. Manually refresh to get the updated status", + "Application Manager either exited or is not running."); + } }, _final: function () { http://git-wip-us.apache.org/repos/asf/tez/blob/c7a946c9/tez-ui/src/main/webapp/app/scripts/helpers/error-bar.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/helpers/error-bar.js b/tez-ui/src/main/webapp/app/scripts/helpers/error-bar.js index b0e876f..dadc829 100644 --- a/tez-ui/src/main/webapp/app/scripts/helpers/error-bar.js +++ b/tez-ui/src/main/webapp/app/scripts/helpers/error-bar.js @@ -46,8 +46,9 @@ App.Helpers.ErrorBar = (function () { if(details) { messageElement = $('<a class="expander" href="#">' + message + '</a>'); - messageElement.click(function () { + messageElement.click(function (event) { errorBar.find('.details').toggleClass('visible'); + event.preventDefault(); }); errorBar.find('.details').html(details.replace(/\n/g, "<br />")); http://git-wip-us.apache.org/repos/asf/tez/blob/c7a946c9/tez-ui/src/main/webapp/app/scripts/mixins/model-refresh-mixin.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/mixins/model-refresh-mixin.js b/tez-ui/src/main/webapp/app/scripts/mixins/model-refresh-mixin.js index d11744e..5ba120f 100644 --- a/tez-ui/src/main/webapp/app/scripts/mixins/model-refresh-mixin.js +++ b/tez-ui/src/main/webapp/app/scripts/mixins/model-refresh-mixin.js @@ -28,6 +28,7 @@ App.ModelRefreshMixin = Em.Mixin.create({ actions: { refresh: function () { + App.Helpers.ErrorBar.getInstance().hide(); this.load(); } } http://git-wip-us.apache.org/repos/asf/tez/blob/c7a946c9/tez-ui/src/main/webapp/app/templates/task/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/templates/task/index.hbs b/tez-ui/src/main/webapp/app/templates/task/index.hbs index 30a0037..05adec4 100644 --- a/tez-ui/src/main/webapp/app/templates/task/index.hbs +++ b/tez-ui/src/main/webapp/app/templates/task/index.hbs @@ -46,10 +46,12 @@ <i {{bind-attr class=':task-status taskIconStatus'}}></i> {{taskStatus}} </td> </tr> - <tr> - <td>Progress</td> - <td>{{bs-progress-animated progressDecimal=progress}}</td> - </tr> + {{#if progress}} + <tr> + <td>Progress</td> + <td>{{bs-progress-animated progressDecimal=progress}}</td> + </tr> + {{/if}} <tr> <td>{{t 'common.time.start'}}</td> <td>{{formatUnixTimestamp startTime}}</td> http://git-wip-us.apache.org/repos/asf/tez/blob/c7a946c9/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs b/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs index 346c44f..d5b7e53 100644 --- a/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs +++ b/tez-ui/src/main/webapp/app/templates/taskAttempt/index.hbs @@ -54,10 +54,12 @@ <i {{bind-attr class=':task-status taskAttemptIconStatus'}}></i> {{taskAttemptStatus}} </td> </tr> - <tr> - <td>Progress</td> - <td>{{bs-progress-animated progressDecimal=progress}}</td> - </tr> + {{#if}} + <tr> + <td>Progress</td> + <td>{{bs-progress-animated progressDecimal=progress}}</td> + </tr> + {{/if}} <tr> <td>{{t 'common.time.start'}}</td> <td>{{formatUnixTimestamp startTime}}</td> http://git-wip-us.apache.org/repos/asf/tez/blob/c7a946c9/tez-ui/src/main/webapp/app/templates/vertex/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/templates/vertex/index.hbs b/tez-ui/src/main/webapp/app/templates/vertex/index.hbs index 437b381..e72aa8e 100644 --- a/tez-ui/src/main/webapp/app/templates/vertex/index.hbs +++ b/tez-ui/src/main/webapp/app/templates/vertex/index.hbs @@ -73,10 +73,12 @@ {{/if}} </td> </tr> + {{#if progress}} <tr> <td>Progress</td> <td>{{bs-progress-animated progressDecimal=progress}}</td> </tr> + {{/if}} <tr> <td>{{t 'common.time.start'}}</td> <td>{{formatUnixTimestamp startTime}}</td>
