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] Commented: (DERBY-4911) restoreIntrFlagIfSeen may throw ShutdownException causing confusing console stack trace at server shutdown
Date Tue, 23 Nov 2010 22:32:13 GMT

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

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

I have studied this one for a bit; Rick saw this on trunk, Knut has
also seen it running a JRockit VM on 10.7 RC1, although on a different
test. The test doesn't really fail in either observation, but a stack
dump appears on the console.

Derby is shutting down for some reason, either due to a database level
error or a normal shutdown connect. Probably a server shutdown.

Another (I think) thread is closing down because DRDAConnThread has lost
contact with the client, cf the stack evidence. During closing the
session the thread calls activation.close from
EmbedPreparedStatement#closeActions but since the db is shut down, this
fails, causing a call to handleException. Since I have now inserted code
in handleException to restore interrupt flags (for the normal case, not
for this use case :), we go looking for the lcc:

   restoreIntrFlagIfSeen calls getContextOrNull

But the shutdown has already called notifyAllActiveThreads, which
interrupts session threads, and also marks the context manager for the
thread with "shutdown = true" (by calling CM#setInterrupted). This
trips up restoreIntrFlagIfSeen's call to getContextOrNull and you see
this exception being thrown on the console,
cf. DRDACinnThread#handleException which calls
server.consoleExceptionPrintTrace(e);


> restoreIntrFlagIfSeen may throw ShutdownException causing confusing console stack trace
at server shutdown
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4911
>                 URL: https://issues.apache.org/jira/browse/DERBY-4911
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.7.1.0, 10.8.0.0
>            Reporter: Dag H. Wanvik
>
> Exception in thread "DRDAConnThread_508"
> org.apache.derby.iapi.error.ShutdownException:
>    at org.apache.derby.iapi.services.context.ContextManager.checkInterrupt(ContextManager.java:437)
>    at org.apache.derby.iapi.services.context.ContextManager.getContext(ContextManager.java:155)
>    at org.apache.derby.iapi.services.context.ContextService.getContextOrNull(ContextService.java:249)
>    at org.apache.derby.iapi.util.InterruptStatus.restoreIntrFlagIfSeen(InterruptStatus.java:158)
>    at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:356)
>    at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2284)
>    at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
>    at org.apache.derby.impl.jdbc.EmbedPreparedStatement.closeActions(EmbedPreparedStatement.java:261)
>    at org.apache.derby.impl.jdbc.EmbedStatement.close(EmbedStatement.java:307)
>    at org.apache.derby.impl.drda.DRDAStatement.close(DRDAStatement.java:1027)
>    at org.apache.derby.impl.drda.Database.close(Database.java:364)
>    at org.apache.derby.impl.drda.Session.close(Session.java:115)
>    at org.apache.derby.impl.drda.DRDAConnThread.closeSession(DRDAConnThread.java:8289)
>    at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:315)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message