db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1129799 - in /db/derby/code/branches/10.8: ./ java/engine/org/apache/derby/iapi/util/ java/engine/org/apache/derby/impl/jdbc/ java/engine/org/apache/derby/impl/services/locks/
Date Tue, 31 May 2011 16:56:09 GMT
Author: dag
Date: Tue May 31 16:56:09 2011
New Revision: 1129799

URL: http://svn.apache.org/viewvc?rev=1129799&view=rev
Log:
DERBY-5243 assert failure in test testRAFReadWriteMultipleThreads: interrupted flag cleared

Backported cleanly from trunk as:

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

Patch DERBY-5243-1: It moves the setting of the interrupted flag to
just before CONN_INTERRUPT exception is thrown as an SQLException back
to the user application, i.e. as late as possible. Previously, we set
the interrupted flag when we first threw the internal
StandardException. The new placement means that we are done with IO to
derby.log which may be behind the problem we are seeing on older
VMs. I ran the new version 100 times on Linux/JDK 5 without seeing the
error, which previously appeared in ca 20% of the runs.



Modified:
    db/derby/code/branches/10.8/   (props changed)
    db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/util/InterruptStatus.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/locks/LockSet.java

Propchange: db/derby/code/branches/10.8/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 31 16:56:09 2011
@@ -1,2 +1,2 @@
 /db/derby/code/branches/10.7:1061570,1061578,1082235
-/db/derby/code/trunk:1063809,1088633,1091000,1091221,1091285,1092067,1092795,1094315,1094572,1094728,1096741,1096890,1097247,1097249,1097460,1097469,1097471,1102826,1103681,1103718,1127825,1129136,1129764
+/db/derby/code/trunk:1063809,1088633,1091000,1091221,1091285,1092067,1092795,1094315,1094572,1094728,1096741,1096890,1097247,1097249,1097460,1097469,1097471,1102826,1103681,1103718,1127825,1129136,1129764,1129797

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/util/InterruptStatus.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/util/InterruptStatus.java?rev=1129799&r1=1129798&r2=1129799&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/util/InterruptStatus.java
(original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/iapi/util/InterruptStatus.java
Tue May 31 16:56:09 2011
@@ -273,8 +273,8 @@ public class InterruptStatus {
 
         if (e != null) {
             lcc.setInterruptedException(null);
-            // Set thread's interrupt status flag back on.
-            Thread.currentThread().interrupt();
+            // Set thread's interrupt status flag back on:
+            // see TransactionResourceImpl#wrapInSQLException
 
             throw e;
         }

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java?rev=1129799&r1=1129798&r2=1129799&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java
(original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java
Tue May 31 16:56:09 2011
@@ -390,6 +390,10 @@ public final class TransactionResourceIm
 
 			StandardException se = (StandardException) thrownException;
 
+            if (SQLState.CONN_INTERRUPT.equals(se.getSQLState())) {
+                Thread.currentThread().interrupt();
+            }
+
             if (se.getCause() == null) {
                 // se is a single, unchained exception. Just convert it to an
                 // SQLException.

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java?rev=1129799&r1=1129798&r2=1129799&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java
(original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java
Tue May 31 16:56:09 2011
@@ -601,7 +601,6 @@ forever:	for (;;) {
                             if (wakeupReason ==
                                     Constants.WAITING_LOCK_INTERRUPTED) {
 
-                                Thread.currentThread().interrupt();
                                 throw StandardException.
                                     newException(SQLState.CONN_INTERRUPT);
 

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/locks/LockSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/locks/LockSet.java?rev=1129799&r1=1129798&r2=1129799&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/locks/LockSet.java
(original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/services/locks/LockSet.java
Tue May 31 16:56:09 2011
@@ -413,8 +413,6 @@ forever:	for (;;) {
                             if (wakeupReason ==
                                     Constants.WAITING_LOCK_INTERRUPTED) {
 
-                                Thread.currentThread().interrupt();
-
                                 throw StandardException.
                                     newException(SQLState.CONN_INTERRUPT);
 



Mime
View raw message