Think this might be related to 
http://tracker.firebirdsql.org/browse/DNET-382

I've been hitting a deadlock between the GC and main threads.

Examining it I've seen that the main thread calls FbTransaction.Rollback 
which, in sequence, locks:
1. The transaction object itself
2. database.SyncObject
3. A GdsStatement object

Whilst the GC thread is calling FbCommand.Dispose, which locks:
1. The command object
2. The same GdsStatement object as above
3. database.SyncObject

(call stacks at end of mail)

Obviously there's a race condition here, between the statement and the 
SyncObject.

As a temporary fix I changed all locks to refer to the 
database.SyncObject, which isn't pretty in terms of scaling, but does 
remove the deadlock.

A better solution might involve adding a transaction synch object, not 
sure though, as I haven't really had the time to go through the code fully.

Scott Morgan

****

Main thread call stack:
FirebirdSql.Data.FirebirdClient.dll!FirebirdSql.Data.Client.Managed.Version10.GdsStatement.TransactionUpdated(object
 
sender, System.EventArgs e) Line 659       C#
FirebirdSql.Data.FirebirdClient.dll!FirebirdSql.Data.Client.Managed.Version10.GdsTransaction.Rollback()
 
Line 207        C#
FirebirdSql.Data.FirebirdClient.dll!FirebirdSql.Data.FirebirdClient.FbTransaction.Rollback()
 
Line 191   C#

GC thread call stack:
FirebirdSql.Data.FirebirdClient.dll!FirebirdSql.Data.Client.Managed.Version11.GdsStatement.Free(int
 
option) Line 205    C#
FirebirdSql.Data.FirebirdClient.dll!FirebirdSql.Data.Common.StatementBase.Release()
 
Line 263    C#
FirebirdSql.Data.FirebirdClient.dll!FirebirdSql.Data.Client.Managed.Version10.GdsStatement.Dispose(bool
 
disposing) Line 183 + 0xa bytes C#
FirebirdSql.Data.FirebirdClient.dll!FirebirdSql.Data.Common.StatementBase.Dispose()
 
Line 178    C#
FirebirdSql.Data.FirebirdClient.dll!FirebirdSql.Data.FirebirdClient.FbCommand.Release()
 
Line 843        C#
FirebirdSql.Data.FirebirdClient.dll!FirebirdSql.Data.FirebirdClient.FbCommand.Dispose(bool
 
disposing) Line 399  C#


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to