db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1091258 - in /db/derby/code/branches/10.8: ./ java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java
Date Mon, 11 Apr 2011 23:49:33 GMT
Author: dag
Date: Mon Apr 11 23:49:33 2011
New Revision: 1091258

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

Backported fix from trunk of patch derby-5185-1a as 

svn merge -c 1091221 https://svn.apache.org/repos/asf/db/derby/code/trunk

Patch derby-5185-1a.diff. Avoid waiting forever in the loop in
recoverContainerAfterInterrupt where we wait for other concurrent
threads to hit the wall (having seen ClosedChannelException), i.e. so
we know they waiting for this thread to clean up. The counting logic
(threadsInPageIO) here needs to be correct, if there is an error, we
could risk waiting forever, as seen in this issue.

This patch should be followed up by a patch to correct the logic, but
until such time, this patch improves on the situation.


Modified:
    db/derby/code/branches/10.8/   (props changed)
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java

Propchange: db/derby/code/branches/10.8/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 11 23:49:33 2011
@@ -1,2 +1,2 @@
 /db/derby/code/branches/10.7:1061570,1061578,1082235
-/db/derby/code/trunk:1063809,1088633,1091000
+/db/derby/code/trunk:1063809,1088633,1091000,1091221

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java?rev=1091258&r1=1091257&r2=1091258&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java
(original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java
Mon Apr 11 23:49:33 2011
@@ -820,8 +820,10 @@ class RAFContainer4 extends RAFContainer
         }
 
         // Wait till other concurrent threads hit the wall
-        // (ClosedChannelException) and are a ready wait for us to clean up, so
-        // we can set them loose when we're done.
+        // (ClosedChannelException) and are a ready waiting for us to clean up,
+        // so we can set them loose when we're done.
+        int retries = MAX_INTERRUPT_RETRIES;
+
         while (true) {
             synchronized (channelCleanupMonitor) {
                 if (threadsInPageIO == 0) {
@@ -831,8 +833,13 @@ class RAFContainer4 extends RAFContainer
                 }
             }
 
+            if (retries-- == 0) {
+                throw StandardException.newException(
+                        SQLState.FILE_IO_INTERRUPTED);
+            }
+
             try {
-                Thread.sleep(10);
+                Thread.sleep(INTERRUPT_RETRY_SLEEP);
             } catch (InterruptedException te) {
                 InterruptStatus.setInterrupted();
             }



Mime
View raw message