db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1094728 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java
Date Mon, 18 Apr 2011 20:12:45 GMT
Author: dag
Date: Mon Apr 18 20:12:45 2011
New Revision: 1094728

URL: http://svn.apache.org/viewvc?rev=1094728&view=rev
Log:
DERBY-5185 store/rollForwardRecovery.sql stuck in RAFContainer4.recoverContainerAfterInterrupt()
during shutdown

Follow-up patch derby-5185-3a which contains safe guard limits to two loops waiting for
a condition variable: wait maximum one minute to avoid infinite hangs.


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java?rev=1094728&r1=1094727&r2=1094728&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java
Mon Apr 18 20:12:45 2011
@@ -308,6 +308,8 @@ class RAFContainer4 extends RAFContainer
             synchronized (channelCleanupMonitor) {
 
                 // Gain entry
+                int retries = MAX_INTERRUPT_RETRIES;
+
                 while (restoreChannelInProgress) {
                     if (Thread.currentThread() == threadDoingRestore) {
                         // Reopening the container will do readEmbryonicPage
@@ -317,8 +319,13 @@ class RAFContainer4 extends RAFContainer
                         break;
                     }
 
+                    if (retries-- == 0) {
+                        throw StandardException.newException(
+                            SQLState.FILE_IO_INTERRUPTED);
+                    }
+
                     try {
-                        channelCleanupMonitor.wait();
+                        channelCleanupMonitor.wait(INTERRUPT_RETRY_SLEEP);
                     } catch (InterruptedException e) {
                         InterruptStatus.setInterrupted();
                     }
@@ -527,9 +534,16 @@ class RAFContainer4 extends RAFContainer
             synchronized (channelCleanupMonitor) {
 
                 // Gain entry
+                int retries = MAX_INTERRUPT_RETRIES;
+
                 while (restoreChannelInProgress) {
+                    if (retries-- == 0) {
+                        throw StandardException.newException(
+                            SQLState.FILE_IO_INTERRUPTED);
+                    }
+
                     try {
-                        channelCleanupMonitor.wait();
+                        channelCleanupMonitor.wait(INTERRUPT_RETRY_SLEEP);
                     } catch (InterruptedException e) {
                         InterruptStatus.setInterrupted();
                     }



Mime
View raw message