db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1038813 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/InterruptStatus.java
Date Wed, 24 Nov 2010 20:55:36 GMT
Author: dag
Date: Wed Nov 24 20:55:35 2010
New Revision: 1038813

URL: http://svn.apache.org/viewvc?rev=1038813&view=rev
Log:
DERBY-4911 restoreIntrFlagIfSeen may throw ShutdownException causing confusing console stack
trace at server shutdown

Patch derby-4911, which makes restoreIntrFlagIfSeen ignore
ShutdownException when trying to find lcc. We sometimes saw a
ShutdownException stack dump on the console when stopping the network
server. restoreIntrFlagIfSeen does nothing useful when we are closing
down anyway, so we can safely ignore the exception.


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/InterruptStatus.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/InterruptStatus.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/InterruptStatus.java?rev=1038813&r1=1038812&r2=1038813&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/InterruptStatus.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/util/InterruptStatus.java Wed Nov
24 20:55:35 2010
@@ -22,6 +22,7 @@
 package org.apache.derby.iapi.util;
 
 import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.error.ShutdownException;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.services.context.ContextService;
@@ -155,9 +156,15 @@ public class InterruptStatus {
      */
     public static void restoreIntrFlagIfSeen() {
 
-        LanguageConnectionContext lcc =
-            (LanguageConnectionContext)ContextService.getContextOrNull(
-                LanguageConnectionContext.CONTEXT_ID);
+        LanguageConnectionContext lcc = null;
+        try {
+            lcc =
+                (LanguageConnectionContext)ContextService.getContextOrNull(
+                    LanguageConnectionContext.CONTEXT_ID);
+        } catch (ShutdownException e) {
+            // Ignore. DERBY-4911 Restoring interrupt flag is moot anyway if we
+            // are closing down.
+        }
 
         if (lcc == null) {
             // no lcc available for this thread, use thread local flag



Mime
View raw message