geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r514870 - in /geronimo/server/trunk/modules: geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/ geronimo-system/src/main/java/org/apache/geronim...
Date Mon, 05 Mar 2007 21:18:27 GMT
Author: kevan
Date: Mon Mar  5 13:18:26 2007
New Revision: 514870

URL: http://svn.apache.org/viewvc?view=rev&rev=514870
Log:
GERONIMO-2114 Log errors which occur during execution of TimerTasks. Otherwise, RuntimeException
or Error kills the Timer thread. Only indication of error is when you attempt to schedule
another TimerTask. This should capture the root cause of the problem

Modified:
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginService.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
    geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java?view=diff&rev=514870&r1=514869&r2=514870
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java
(original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/AbstractSinglePoolConnectionInterceptor.java
Mon Mar  5 13:18:26 2007
@@ -304,6 +304,8 @@
                     interceptor.internalReturn(killInfo, ConnectionReturnAction.DESTROY);
                 }
                 interceptor.permits.release(killList.size());
+            } catch (Throwable t) {
+                log.error("Error occurred during execution of ExpirationMonitor TimerTask",
t);
             } finally {
                 interceptor.resizeLock.readLock().unlock();
             }
@@ -342,6 +344,8 @@
                         return;
                     }
                 }
+            } catch (Throwable t) {
+                log.error("FillTask encountered error in run method", t);
             } finally {
                 resizeLock.readLock().unlock();
             }

Modified: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginService.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginService.java?view=diff&rev=514870&r1=514869&r2=514870
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginService.java
(original)
+++ geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginService.java
Mon Mar  5 13:18:26 2007
@@ -410,23 +410,27 @@
     private class ExpirationMonitor extends TimerTask { //todo: different timeouts per realm?
 
         public void run() {
-            long now = System.currentTimeMillis();
-            List list = new LinkedList();
-            synchronized (activeLogins) {
-                for (Iterator it = activeLogins.keySet().iterator(); it.hasNext();) {
-                    JaasSessionId id = (JaasSessionId) it.next();
-                    JaasSecuritySession session = (JaasSecuritySession) activeLogins.get(id);
-                    int age = (int) (now - session.getCreated());
-                    if (session.isDone() || age > maxLoginDurationMillis) {
-                        list.add(session);
-                        session.setDone(true);
-                        it.remove();
+            try {
+                long now = System.currentTimeMillis();
+                List list = new LinkedList();
+                synchronized (activeLogins) {
+                    for (Iterator it = activeLogins.keySet().iterator(); it.hasNext();) {
+                        JaasSessionId id = (JaasSessionId) it.next();
+                        JaasSecuritySession session = (JaasSecuritySession) activeLogins.get(id);
+                        int age = (int) (now - session.getCreated());
+                        if (session.isDone() || age > maxLoginDurationMillis) {
+                            list.add(session);
+                            session.setDone(true);
+                            it.remove();
+                        }
                     }
                 }
-            }
-            for (Iterator it = list.iterator(); it.hasNext();) {
-                JaasSecuritySession session = (JaasSecuritySession) it.next();
-                ContextManager.unregisterSubject(session.getSubject());
+                for (Iterator it = list.iterator(); it.hasNext();) {
+                    JaasSecuritySession session = (JaasSecuritySession) it.next();
+                    ContextManager.unregisterSubject(session.getSubject());
+                }
+            } catch (Throwable t) {
+                log.error("Error occurred during execution of ExpirationMonitor TimerTask",
t);
             }
         }
     }

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?view=diff&rev=514870&r1=514869&r2=514870
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
Mon Mar  5 13:18:26 2007
@@ -599,7 +599,9 @@
                     try {
                         LocalAttributeManager.this.save();
                     } catch (IOException e) {
-                        log.error("Error saving attributes", e);
+                        log.error("IOException occurred while saving attributes", e);
+                    } catch (Throwable t) {
+                        log.error("Error occurred during execution of attributeChanged TimerTask",
t);
                     }
                 }
             };

Modified: geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java?view=diff&rev=514870&r1=514869&r2=514870
==============================================================================
--- geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java
(original)
+++ geronimo/server/trunk/modules/geronimo-timer/src/main/java/org/apache/geronimo/timer/ExecutorFeedingTimerTask.java
Mon Mar  5 13:18:26 2007
@@ -47,7 +47,11 @@
     }
 
     public void run() {
-        threadPooledTimer.getExecutor().execute(workInfo.getExecutorTask());
+        try {
+            threadPooledTimer.getExecutor().execute(workInfo.getExecutorTask());
+        } catch (Throwable t) {
+            log.error("Error occurred during execution of ExpirationMonitor TimerTask", t);
+        }
     }
 
     public boolean cancel() {



Mime
View raw message