db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (DERBY-5243) assert failure in test testRAFReadWriteMultipleThreads: interrupted flag cleared
Date Mon, 23 May 2011 22:25:47 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038278#comment-13038278
] 

Dag H. Wanvik edited comment on DERBY-5243 at 5/23/11 10:24 PM:
----------------------------------------------------------------

Using DERBY-5243-instrument, a typical trace looks like this:

Thread           |                        code location     |    isInterrupted()
-----------------------------------------------------------------------------
..
  Thread[WorkerThread. Thread#5,5,main] CM.cleanuponerror 0 : true
  Thread[WorkerThread. Thread#5,5,main] CM.cleanuponerror 0.1 : true
  Thread[WorkerThread. Thread#5,5,main] CM.cleanuponerror 0.2 : true
  Thread[WorkerThread. Thread#5,5,main] CM.cleanuponerror 0.3 : true
  Thread[WorkerThread. Thread#4,5,main] CM.cleanuponerror 0 : true
  Thread[WorkerThread. Thread#4,5,main] CM.cleanuponerror 0.1 : true
  Thread[WorkerThread. Thread#4,5,main] CM.cleanuponerror 0.2 : true
  Thread[WorkerThread. Thread#4,5,main] CM.cleanuponerror 0.3 : true
  Thread[WorkerThread. Thread#6,5,main] CM.cleanuponerror 0 : true
  Thread[WorkerThread. Thread#6,5,main] CM.cleanuponerror 0.1 : true
  Thread[WorkerThread. Thread#6,5,main] CM.cleanuponerror 0.2 : true
  Thread[WorkerThread. Thread#6,5,main] CM.cleanuponerror 0.3 : true
  Thread[WorkerThread. Thread#4,5,main] CM.cleanuponerror 1 : true
  Thread[WorkerThread. Thread#4,5,main] stackTrace 0 : true
  Thread[WorkerThread. Thread#4,5,main] stackTrace 1 : true
  Thread[WorkerThread. Thread#6,5,main] CM.cleanuponerror 1 : true
  Thread[WorkerThread. Thread#6,5,main] stackTrace 0 : true
  Thread[WorkerThread. Thread#6,5,main] stackTrace 1 : true                  Still OK
  
  >>>>>>>>> 
  Thread[WorkerThread. Thread#5,5,main] CM.cleanuponerror 1 : true
  Thread[WorkerThread. Thread#5,5,main] stackTrace 0 : true
  Thread[WorkerThread. Thread#5,5,main] stackTrace 1 : true
  <<<<<<<<< 
  
  Thread[WorkerThread. Thread#6,5,main] stackTrace 2 : false                 Cleared!
  Thread[WorkerThread. Thread#6,5,main] CM.cleanuponerror 2 : false
  Thread[WorkerThread. Thread#6,5,main] exitting!
  Thread[WorkerThread. Thread#5,5,main] stackTrace 2 : false
  Thread[WorkerThread. Thread#5,5,main] CM.cleanuponerror 2 : false
  Thread[WorkerThread. Thread#5,5,main] exitting!
  Thread[WorkerThread. Thread#4,5,main] stackTrace 2 : true
  Thread[WorkerThread. Thread#4,5,main] CM.cleanuponerror 2 : true

We see that the flag is cleared when the code for thread 6 reaches
tracepoint "stackTrace 2". The only thing the thread has done in the
meantime is call Throwable.printStackTrace(PrintWriter). So the
conclusion must be that somehow, the interrupt on thread 5 must have
led to thread 6's flag being cleared.


      was (Author: dagw):
    Using DERBY-5243-instrument, a typical trace looks like this:

Thread                                  code location         isInterrupted()
-----------------------------------------------------------------------------
..
  Thread[WorkerThread. Thread#5,5,main] CM.cleanuponerror 0 : true
  Thread[WorkerThread. Thread#5,5,main] CM.cleanuponerror 0.1 : true
  Thread[WorkerThread. Thread#5,5,main] CM.cleanuponerror 0.2 : true
  Thread[WorkerThread. Thread#5,5,main] CM.cleanuponerror 0.3 : true
  Thread[WorkerThread. Thread#4,5,main] CM.cleanuponerror 0 : true
  Thread[WorkerThread. Thread#4,5,main] CM.cleanuponerror 0.1 : true
  Thread[WorkerThread. Thread#4,5,main] CM.cleanuponerror 0.2 : true
  Thread[WorkerThread. Thread#4,5,main] CM.cleanuponerror 0.3 : true
  Thread[WorkerThread. Thread#6,5,main] CM.cleanuponerror 0 : true
  Thread[WorkerThread. Thread#6,5,main] CM.cleanuponerror 0.1 : true
  Thread[WorkerThread. Thread#6,5,main] CM.cleanuponerror 0.2 : true
  Thread[WorkerThread. Thread#6,5,main] CM.cleanuponerror 0.3 : true
  Thread[WorkerThread. Thread#4,5,main] CM.cleanuponerror 1 : true
  Thread[WorkerThread. Thread#4,5,main] stackTrace 0 : true
  Thread[WorkerThread. Thread#4,5,main] stackTrace 1 : true
  Thread[WorkerThread. Thread#6,5,main] CM.cleanuponerror 1 : true
  Thread[WorkerThread. Thread#6,5,main] stackTrace 0 : true
  Thread[WorkerThread. Thread#6,5,main] stackTrace 1 : true                  Still OK
  
  >>>>>>>>> 
  Thread[WorkerThread. Thread#5,5,main] CM.cleanuponerror 1 : true
  Thread[WorkerThread. Thread#5,5,main] stackTrace 0 : true
  Thread[WorkerThread. Thread#5,5,main] stackTrace 1 : true
  <<<<<<<<< 
  
  Thread[WorkerThread. Thread#6,5,main] stackTrace 2 : false                 Cleared!
  Thread[WorkerThread. Thread#6,5,main] CM.cleanuponerror 2 : false
  Thread[WorkerThread. Thread#6,5,main] exitting!
  Thread[WorkerThread. Thread#5,5,main] stackTrace 2 : false
  Thread[WorkerThread. Thread#5,5,main] CM.cleanuponerror 2 : false
  Thread[WorkerThread. Thread#5,5,main] exitting!
  Thread[WorkerThread. Thread#4,5,main] stackTrace 2 : true
  Thread[WorkerThread. Thread#4,5,main] CM.cleanuponerror 2 : true

We see that the flag is cleared when the code for thread 6 reaches
tracepoint "stackTrace 2". The only thing the thread has done in the
meantime is call Throwable.printStackTrace(PrintWriter). So the
conclusion must be that somehow, the interrupt on thread 5 must have
led to thread 6's flag being cleared.

  
> assert failure in test testRAFReadWriteMultipleThreads: interrupted flag cleared
> --------------------------------------------------------------------------------
>
>                 Key: DERBY-5243
>                 URL: https://issues.apache.org/jira/browse/DERBY-5243
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.8.1.2
>         Environment: Linux, Sun JDK 1.4.2u25 and JDK 5. Not seen or JDK 6 or 7, or other
OS than Linux
>            Reporter: Dag H. Wanvik
>            Priority: Minor
>         Attachments: DERBY-5243-instrument.diff, DERBY-5243-instrument.stat
>
>
> This is another instance of an interrupted thread losing its interrupted flag after calling
Derby, but I believe this is distinct from other we have seen.
> 1) testRAFReadWriteMultipleThreads(org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest)java.sql.SQLException:
The exception 'junit.framework.AssertionFailedError: WorkerThread 0' was thrown while evaluating
an expression.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source)
> 	at org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest.testRAFReadWriteMultipleThreads(InterruptResilienceTest.java:532)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:112)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> Caused by: java.sql.SQLException: Java exception: 'WorkerThread 0: junit.framework.AssertionFailedError'.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
> 	... 45 more
> Caused by: junit.framework.AssertionFailedError: WorkerThread 0
> 	at org.apache.derbyTesting.junit.BaseTestCase.fail(BaseTestCase.java:771)
> 	at org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest.tstRAFReadWriteMultipleThreads(InterruptResilienceTest.java:323)
> 	at org.apache.derby.exe.ac070a00b0x0130x06edxad12x000062ebfce90.g0(Unknown Source)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	... 41 more
> Caused by: junit.framework.AssertionFailedError
> 	at org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest$WorkerThread.run(InterruptResilienceTest.java:430)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message