You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by da...@apache.org on 2011/05/31 18:47:37 UTC
svn commit: r1129797 - in /db/derby/code/trunk/java/engine/org/apache/derby:
iapi/util/InterruptStatus.java impl/jdbc/TransactionResourceImpl.java
impl/services/locks/ConcurrentLockSet.java impl/services/locks/LockSet.java
Author: dag
Date: Tue May 31 16:47:36 2011
New Revision: 1129797
URL: http://svn.apache.org/viewvc?rev=1129797&view=rev
Log:
DERBY-5243 assert failure in test testRAFReadWriteMultipleThreads: interrupted flag cleared
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/trunk/java/engine/org/apache/derby/iapi/util/InterruptStatus.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.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=1129797&r1=1129796&r2=1129797&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 Tue May 31 16:47:36 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/trunk/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java?rev=1129797&r1=1129796&r2=1129797&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java Tue May 31 16:47:36 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/trunk/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java?rev=1129797&r1=1129796&r2=1129797&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java Tue May 31 16:47:36 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/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java?rev=1129797&r1=1129796&r2=1129797&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java Tue May 31 16:47:36 2011
@@ -413,8 +413,6 @@ forever: for (;;) {
if (wakeupReason ==
Constants.WAITING_LOCK_INTERRUPTED) {
- Thread.currentThread().interrupt();
-
throw StandardException.
newException(SQLState.CONN_INTERRUPT);