revision 11874 is too aggressive and can kill session prematurely.

Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2979748
This commit is contained in:
Heng Sin Low 2010-04-01 21:41:34 +00:00
parent c7cb6449c4
commit ea22b39541
2 changed files with 9 additions and 5 deletions

View File

@ -75,6 +75,7 @@ public class DashboardRunnable implements Runnable, Serializable
{ {
// default Update every one minutes // default Update every one minutes
int interval = MSysConfig.getIntValue(ZK_DASHBOARD_REFRESH_INTERVAL, 60000); int interval = MSysConfig.getIntValue(ZK_DASHBOARD_REFRESH_INTERVAL, 60000);
int cumulativeFailure = 0;
while(!stop) { while(!stop) {
try { try {
Thread.sleep(interval); Thread.sleep(interval);
@ -86,14 +87,17 @@ public class DashboardRunnable implements Runnable, Serializable
Locales.setThreadLocal(locale); Locales.setThreadLocal(locale);
try { try {
refreshDashboard(); refreshDashboard();
cumulativeFailure = 0;
} catch (DesktopUnavailableException de) { } catch (DesktopUnavailableException de) {
killSession(); cumulativeFailure++;
break;
} catch (Exception e) { } catch (Exception e) {
logger.log(Level.INFO, e.getLocalizedMessage(), (e.getCause() != null ? e.getCause() : e)); logger.log(Level.INFO, e.getLocalizedMessage(), (e.getCause() != null ? e.getCause() : e));
break; cumulativeFailure++;
} }
if (cumulativeFailure > 3)
break;
} else { } else {
logger.log(Level.INFO, "Desktop destroy, will kill session.");
killSession(); killSession();
break; break;
} }

View File

@ -46,8 +46,8 @@ public class ServerPushTemplate {
try { try {
if (!inUIThread) { if (!inUIThread) {
//half second timeout //10 minutes timeout
if (Executions.activate(desktop, 500)) { if (Executions.activate(desktop, 10 * 60 * 1000)) {
desktopActivated = true; desktopActivated = true;
} else { } else {
throw new DesktopUnavailableException("Timeout activating desktop."); throw new DesktopUnavailableException("Timeout activating desktop.");