You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Ibrahim Hasbini <ha...@gmail.com> on 2010/05/03 19:55:33 UTC

Intermittent "Connection closed by unknown interrupt." errors

Hello,

I've been experiencing intermittent errors in derby.log that look like this:
The errors are causing queries to fail.


2010-05-03 11:29:29.400 GMT Thread[GC.EndPointInfo Runnable Thread -
xyz.middleware.remoting.connection.GC$EndPointInfo$1@1cf3127,5,main]
(XID = 1089), (SESSIONID = 3), (DATABASE =
.xyz/middleware/registry/middleware.registry/db), (DRDAID = null),
Failed Statement is: null with 1 parameters begin parameter #1: 227
:end parameter
ERROR 08000: Connection closed by unknown interrupt.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.iapi.error.StandardException.interrupt(Unknown Source)
	at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
	at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
	at org.apache.derby.impl.store.raw.log.FileLogger.flush(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.Xact.prepareCommit(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.Xact.commit(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.Xact.commit(Unknown Source)
	at org.apache.derby.impl.store.access.RAMTransaction.commit(Unknown Source)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.doCommit(Unknown
Source)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.userCommit(Unknown
Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.commit(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.commit(Unknown Source)
	at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:334)
	at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:211)
(...)
Caused by: java.lang.InterruptedException
	at java.lang.Object.wait(Native Method)
	at java.lang.Object.wait(Object.java:485)
	at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
	at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
	at org.apache.derby.impl.store.raw.log.FileLogger.flush(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.Xact.prepareCommit(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.Xact.commit(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.Xact.commit(Unknown Source)
	at org.apache.derby.impl.store.access.RAMTransaction.commit(Unknown Source)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.doCommit(Unknown
Source)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.userCommit(Unknown
Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.commit(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.commit(Unknown Source)
	at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:334)
	at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:211)

followed by:

------------  BEGIN SHUTDOWN ERROR STACK -------------

ERROR XSTB0: An exception was thrown during transaction abort.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.Xact.preComplete(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.Xact.abort(Unknown Source)
	at org.apache.derby.impl.store.raw.xact.XactContext.cleanupOnError(Unknown
Source)
	at org.apache.derby.iapi.services.context.ContextManager.cleanupOnError(Unknown
Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.cleanupOnError(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.EmbedConnection.commit(Unknown Source)
	at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:334)
	at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:211)
(...)

------------  END SHUTDOWN ERROR STACK -------------

Has anyone encountered such errors before?

the error has been observed on: JDKs 1.6_13, 1.6_14 and 1.6_18

I've also posted a bug report for this issue:
https://issues.apache.org/jira/browse/DERBY-4640


Thanks in advance for your help.

Re: Intermittent "Connection closed by unknown interrupt." errors

Posted by Brett Wooldridge <br...@gmail.com>.
Ibrahim,

Who owns the thread in question?  Is it created by a web-container?  An
application container?  You?

If it is created by a web-container or app-container, there may be some kind
of lifecycle management going on where the container interrupts a thread
that is running too long (from it's perspective).

-Brett


On Tue, May 4, 2010 at 4:48 PM, Ibrahim Hasbini <ha...@gmail.com> wrote:

> Hello,
>
> There's no calls to Thread.interrupt() in my application code. I'm
> still unable to explain from where the interrupt is being generated.
>
> Thanks,
> Ibrahim
>
> >> I've been experiencing intermittent errors in derby.log that look like
> this:
>
> >> Caused by: java.lang.InterruptedException
> >>      at java.lang.Object.wait(Native Method)
> >>      at java.lang.Object.wait(Object.java:485)
> >>      at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown
> Source)
> >>      at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown
> Source)
> >
> >Do you call Thread.interrupt() anywhere in your application?
> >http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#interrupt()
> >
> >This API is, unfortunately, unsafe to call in a Derby-based application,
> as the
> >Derby code does not protect itself from these interrupt() calls.
> >
> >thanks,
> >
> >bryan
>

Re: Intermittent "Connection closed by unknown interrupt." errors

Posted by Ibrahim Hasbini <ha...@gmail.com>.
Hello,

There's no calls to Thread.interrupt() in my application code. I'm
still unable to explain from where the interrupt is being generated.

Thanks,
Ibrahim

>> I've been experiencing intermittent errors in derby.log that look like this:

>> Caused by: java.lang.InterruptedException
>> 	at java.lang.Object.wait(Native Method)
>> 	at java.lang.Object.wait(Object.java:485)
>> 	at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
>> 	at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
>
>Do you call Thread.interrupt() anywhere in your application?
>http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#interrupt()
>
>This API is, unfortunately, unsafe to call in a Derby-based application, as the
>Derby code does not protect itself from these interrupt() calls.
>
>thanks,
>
>bryan

Re: Intermittent "Connection closed by unknown interrupt." errors

Posted by Bryan Pendleton <bp...@gmail.com>.
> I've been experiencing intermittent errors in derby.log that look like this:

> Caused by: java.lang.InterruptedException
> 	at java.lang.Object.wait(Native Method)
> 	at java.lang.Object.wait(Object.java:485)
> 	at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
> 	at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)

Do you call Thread.interrupt() anywhere in your application?
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#interrupt()

This API is, unfortunately, unsafe to call in a Derby-based application, as the
Derby code does not protect itself from these interrupt() calls.

thanks,

bryan