You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2014/11/08 22:55:42 UTC
ambari git commit: AMBARI-8320. Error in persisting web client state
at ambari server: Error 500 \!hex:5c. (jaimin)
Repository: ambari
Updated Branches:
refs/heads/branch-1.7.0 7c51a3e53 -> 9d4d26cb8
AMBARI-8320. Error in persisting web client state at ambari server: Error 500 \!hex:5c. (jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9d4d26cb
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9d4d26cb
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9d4d26cb
Branch: refs/heads/branch-1.7.0
Commit: 9d4d26cb837503ed090dcb6a66fc5d6e7d4c9240
Parents: 7c51a3e
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Sat Nov 8 13:55:06 2014 -0800
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Sat Nov 8 13:55:06 2014 -0800
----------------------------------------------------------------------
ambari-web/app/config.js | 1 +
ambari-web/app/controllers/application.js | 17 +++++++++++++++++
ambari-web/app/router.js | 2 ++
ambari-web/app/routes/installer.js | 2 ++
ambari-web/app/routes/main.js | 2 ++
5 files changed, 24 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9d4d26cb/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index e2b745d..8e801d3 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -31,6 +31,7 @@ App.defaultStackVersion = 'HDP-2.2';
App.defaultJavaHome = '/usr/jdk/jdk1.6.0_31';
App.timeout = 180000; // default AJAX timeout
App.maxRetries = 3; // max number of retries for certain AJAX calls
+App.sessionKeepAliveInterval = 60000;
App.bgOperationsUpdateInterval = 6000;
App.componentsUpdateInterval = 6000;
App.contentUpdateInterval = 15000;
http://git-wip-us.apache.org/repos/asf/ambari/blob/9d4d26cb/ambari-web/app/controllers/application.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/application.js b/ambari-web/app/controllers/application.js
index 3da9060..87cc6b5 100644
--- a/ambari-web/app/controllers/application.js
+++ b/ambari-web/app/controllers/application.js
@@ -23,6 +23,8 @@ App.ApplicationController = Em.Controller.extend(App.UserPref, {
name: 'applicationController',
+ isPollerRunning: false,
+
clusterName: function () {
return (App.router.get('clusterController.clusterName') || 'My Cluster');
}.property('App.router.clusterController.clusterName'),
@@ -51,6 +53,21 @@ App.ApplicationController = Em.Controller.extend(App.UserPref, {
this._super();
},
+ startKeepAlivePoller: function() {
+ if (!this.get('isPollerRunning')) {
+ this.set('isPollerRunning',true);
+ App.updater.run(this, 'getStack', 'isPollerRunning', App.sessionKeepAliveInterval);
+ }
+ },
+
+ getStack: function(callback) {
+ App.ajax.send({
+ name: 'router.login.clusters',
+ sender: this,
+ callback: callback
+ });
+ },
+
dataLoading: function () {
var dfd = $.Deferred();
var self = this;
http://git-wip-us.apache.org/repos/asf/ambari/blob/9d4d26cb/ambari-web/app/router.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js
index c8ab2d7..f567fef 100644
--- a/ambari-web/app/router.js
+++ b/ambari-web/app/router.js
@@ -387,6 +387,8 @@ App.Router = Em.Router.extend({
logOffSuccessCallback: function (data) {
console.log("invoked logout on the server successfully");
+ var applicationController = App.router.get('applicationController');
+ applicationController.set('isPollerRunning',false);
},
logOffErrorCallback: function (req) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/9d4d26cb/ambari-web/app/routes/installer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js
index 350e430..e7f88c9 100644
--- a/ambari-web/app/routes/installer.js
+++ b/ambari-web/app/routes/installer.js
@@ -29,6 +29,8 @@ module.exports = Em.Route.extend({
router.getAuthenticated().done(function (loggedIn) {
if (loggedIn) {
+ var applicationController = router.get('applicationController');
+ applicationController.startKeepAlivePoller();
// check server/web client versions match
App.router.get('installerController').checkServerClientVersion().done(function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/9d4d26cb/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 992f934..9440d02 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -26,6 +26,8 @@ module.exports = Em.Route.extend({
console.log('in /main:enter');
router.getAuthenticated().done(function (loggedIn) {
if (loggedIn) {
+ var applicationController = App.router.get('applicationController');
+ applicationController.startKeepAlivePoller();
App.router.get('mainController').checkServerClientVersion().done(function () {
App.router.get('mainViewsController').loadAmbariViews();
App.router.get('clusterController').loadClusterName(false).done(function () {