You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Dag H. Wanvik (JIRA)" <ji...@apache.org> on 2011/03/17 13:48:30 UTC

[jira] Commented: (DERBY-5140) Intermittent failure in InterruptResilienceTest: test thread doing join on worker thread gets interrupted

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

Dag H. Wanvik commented on DERBY-5140:
--------------------------------------

This part of the stack is interesting:

Caused by: java.lang.InterruptedException
  at java.lang.Object.wait(Native Method)
  at java.lang.Thread.join(Thread.java:1001)
  at java.lang.Thread.join(Thread.java:1054)
  at org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest.tstRAFReadWriteMultipleThreads(InterruptResilienceTest.java:244)
  at org.apache.derby.exe.ac070a00b0x012ex6c08x9759x00006a12110b0.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)

It shows that the thread driving the test sees an interrupt (in the
join waiting for the worked threads to terminate. Now, the interruptor
threads should only be interrupting the worker threads themselves, not
the driver test thread that started (and is now waiting for) the
worker threads. I am not sure how this join could get interrupted,
because the specification of Thread#join states that it will only
throw InterruptedException iff the thread doing the join (i.e. the
joinee) is interrupted.

Possible theories:
a) That somehow the exception is delivered to the wrong thread iff the
worker thread is in the final stages when it receives an interrupt
from the interruptor threads

b) The interrupts emanates from Derby shutdown, which his hard to see
could be happening here: we are still inside a test
(testRAFReadWriteMultipleThreads), in embedded mode.

Note that this run has already seen a failure in
AutomaticIndexStatisticsTest#testShutdownWhileScanningThenDelete prior
to hitting the error in InterruptResilienceTest. I don't have no
reason to suspect that the two are related at this point, though. 

> Intermittent failure in InterruptResilienceTest: test thread doing join on worker thread gets interrupted
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5140
>                 URL: https://issues.apache.org/jira/browse/DERBY-5140
>             Project: Derby
>          Issue Type: Bug
>         Environment: Windows 2003/Java 1.4.2
>            Reporter: Dag H. Wanvik
>
> Cf. http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.4/testing/testlog/w2003/1075087-suitesAll_diff.txt
>   
>   testRAFReadWriteMultipleThreads(org.apache.derbyTesting.functionTests.tests.store.InterruptResilienceTest)java.sql.SQLException: The exception 'java.lang.InterruptedException' 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:515)
> ] 

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