You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by su...@apache.org on 2018/08/03 13:48:49 UTC

hadoop git commit: YARN-8620. [UI2] YARN Services UI new submission failures are not debuggable. Contributed by Akhil PB.

Repository: hadoop
Updated Branches:
  refs/heads/trunk 022592ae7 -> 29417dbbf


YARN-8620. [UI2] YARN Services UI new submission failures are not debuggable. Contributed by Akhil PB.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/29417dbb
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/29417dbb
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/29417dbb

Branch: refs/heads/trunk
Commit: 29417dbbf4f6e3881baaaa97408b335c32fe6708
Parents: 022592a
Author: Sunil G <su...@apache.org>
Authored: Fri Aug 3 19:12:34 2018 +0530
Committer: Sunil G <su...@apache.org>
Committed: Fri Aug 3 19:12:34 2018 +0530

----------------------------------------------------------------------
 .../src/main/webapp/app/adapters/yarn-servicedef.js      | 11 ++++++++++-
 .../src/main/webapp/app/controllers/yarn-app.js          | 10 ++++++++--
 .../main/webapp/app/controllers/yarn-deploy-service.js   |  8 ++++++--
 .../src/main/webapp/app/templates/yarn-app.hbs           | 10 ++++++----
 4 files changed, 30 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/29417dbb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-servicedef.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-servicedef.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-servicedef.js
index 9000d74..954aafc 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-servicedef.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-servicedef.js
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-import Ember from 'ember';
 import RESTAbstractAdapter from './restabstract';
 
 export default RESTAbstractAdapter.extend({
@@ -24,6 +23,16 @@ export default RESTAbstractAdapter.extend({
   restNameSpace: "dashService",
   serverName: "DASH",
 
+  normalizeErrorResponse(status, headers, payload) {
+    if (payload && typeof payload === 'object' && payload.errors) {
+      return payload.errors;
+    } else {
+      return [
+        payload
+      ];
+    }
+  },
+
   deployService(request, user) {
     var url = this.buildURL();
     if(user) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/29417dbb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js
index a4f220a..799c8d2 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app.js
@@ -50,7 +50,10 @@ export default Ember.Controller.extend({
           this.send("refresh");
         }, 5000);
       }, function (errr) {
-        let messg = errr.diagnostics || 'Error: Stop service failed!';
+        let messg = 'Error: Stop service failed!';
+        if (errr.errors && errr.errors[0] && errr.errors[0].diagnostics) {
+          messg = 'Error: ' + errr.errors[0].diagnostics;
+        }
         self.set('actionResponse', { msg: messg, type: 'error' });
       }).finally(function () {
         self.set('isLoading', false);
@@ -74,7 +77,10 @@ export default Ember.Controller.extend({
           this.transitionToRoute("yarn-services");
         }, 5000);
       }, function (errr) {
-        let messg = errr.diagnostics || 'Error: Delete service failed!';
+        let messg = 'Error: Delete service failed!';
+        if (errr.errors && errr.errors[0] && errr.errors[0].diagnostics) {
+          messg = 'Error: ' + errr.errors[0].diagnostics;
+        }
         self.set('actionResponse', { msg: messg, type: 'error' });
       }).finally(function () {
         self.set('isLoading', false);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/29417dbb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-deploy-service.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-deploy-service.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-deploy-service.js
index 97cb66f..38c84d6 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-deploy-service.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-deploy-service.js
@@ -60,8 +60,12 @@ export default Ember.Controller.extend({
     adapter.deployService(requestJson, userName).then(function() {
       self.set('serviceResponse', {message: 'Service has been accepted successfully. Redirecting to services in a second.', type: 'success'});
       self.gotoServices();
-    }, function(errmsg) {
-      self.set('serviceResponse', {message: errmsg, type: 'error'});
+    }, function(errr) {
+      let messg = 'Error: Deploy service failed!';
+      if (errr.errors && errr.errors[0] && errr.errors[0].diagnostics) {
+        messg = 'Error: ' + errr.errors[0].diagnostics;
+      }
+      self.set('serviceResponse', {message: messg, type: 'error'});
     }).finally(function() {
       self.set('isLoading', false);
     });

http://git-wip-us.apache.org/repos/asf/hadoop/blob/29417dbb/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs
index cb28f82..ff166e3 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app.hbs
@@ -19,10 +19,12 @@
 {{breadcrumb-bar breadcrumbs=breadcrumbs}}
 
 {{#if actionResponse}}
-  <div class="col-md-12">
-    <div class="alert alert-dismissible {{if (eq actionResponse.type 'error') 'alert-danger' 'alert-success'}}" role="alert">
-      <button class="close" data-dismiss="alert" aria-label="Close" {{action "resetActionResponse"}}><span aria-hidden="true">&times;</span></button>
-      <strong>{{actionResponse.msg}}</strong>
+  <div class="row">
+    <div class="col-md-12">
+      <div class="alert alert-dismissible {{if (eq actionResponse.type 'error') 'alert-danger' 'alert-success'}}" role="alert">
+        <button class="close" data-dismiss="alert" aria-label="Close" {{action "resetActionResponse"}}><span aria-hidden="true">&times;</span></button>
+        <strong>{{actionResponse.msg}}</strong>
+      </div>
     </div>
   </div>
 {{/if}}


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