db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1038816 - in /db/derby/code/branches/10.7: ./ java/engine/org/apache/derby/iapi/util/InterruptStatus.java
Date Wed, 24 Nov 2010 20:59:54 GMT
Author: dag
Date: Wed Nov 24 20:59:53 2010
New Revision: 1038816

URL: http://svn.apache.org/viewvc?rev=1038816&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.

Backported from trunk as svc merge -c 1038813

Modified:
    db/derby/code/branches/10.7/   (props changed)
    db/derby/code/branches/10.7/java/engine/org/apache/derby/iapi/util/InterruptStatus.java

Propchange: db/derby/code/branches/10.7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 24 20:59:53 2010
@@ -1 +1 @@
-/db/derby/code/trunk:1035603,1036769
+/db/derby/code/trunk:1035603,1036769,1038813

Modified: db/derby/code/branches/10.7/java/engine/org/apache/derby/iapi/util/InterruptStatus.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/engine/org/apache/derby/iapi/util/InterruptStatus.java?rev=1038816&r1=1038815&r2=1038816&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/engine/org/apache/derby/iapi/util/InterruptStatus.java
(original)
+++ db/derby/code/branches/10.7/java/engine/org/apache/derby/iapi/util/InterruptStatus.java
Wed Nov 24 20:59:53 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