Deadlocks

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
jvel
Posts: 27
Joined: Wed Mar 09, 2011 8:51 am
Location: UK

Deadlocks

Post by jvel » Mon Oct 03, 2011 10:15 am

A few months ago (mid-July) we upgraded from Vault 4.1.1 to 5.1.1.19215. Since then I've heard a few vague complaints about the Vault client locking up and/or failing. Today I've had a screenshot showing the time of the failure, so I've been looking through the Vault log (level=debug) and discovered it was due to a deadlock (see below).

Curious, I searched all our old logs and found that with Vault 4.1 we had 11 deadlocks in 9 months, but with 5.1 we've had 12 deadlocks in 12 weeks. With 4.1 most of the deadlocks were from CCNet on our build machines trying to BeginVersionHistoryQuery, so no-one noticed much. With 5.1 it's mostly normal user operations that are failing - checkin, checkout, undo checkout, branch.

So my questions are: What can I do to avoid/lessen these deadlocks? Is there anything different in 5.1 that might be making them more frequent? What could I do to help track them down?

My Vault IIS server is Windows Server 2003 R2, Standard x64 Edition, Service Pack 2.
The hardware is Dell Server PE2950, Intel Xeon CPU, X5355 @ 2.66GHz, 4GB RAM.
It does have SQL Server 2008 R2 (10.50.1600), but rarely used.

My Vault database server is Windows Server 2003 R2, Standard Edition (32bit), Service Pack 2.
The hardware is Dell Server PE2950, Intel Xeon CPU, E5420 @ 2.50GHz, 4GB RAM.
The database is SQL Server 2005 (9.0.3042).

We have 15 Vault licences, but normally only 8 to 10 users at one time. Additionally we have two VMs running CCNet (1.4 and 1.6) building about 15 projects.

This was the latest deadlock:

Code: Select all

----03/10/2011 14:23:07      paulh--89.0.1.165(89.0.1.165)--SSL Disabled	System.Data.SqlClient.SqlException: Transaction (Process ID 61) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at VaultServiceSQL.VaultSqlSCC.CreateSessionBranchSandbox(VaultSqlConn conn, String strSessionID, Int32 nRepID, Int32 nTxItem, Byte nTxType, Int64 nObjVerID)    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at VaultServiceSQL.VaultSqlSCC.CreateSessionBranchSandbox(VaultSqlConn conn, String strSessionID, Int32 nRepID, Int32 nTxItem, Byte nTxType, Int64 nObjVerID)
----03/10/2011 14:23:07      paulh--89.0.1.165(89.0.1.165)--SSL Disabled	BeginTx: Failure 
----03/10/2011 14:23:07      paulh--89.0.1.165(89.0.1.165)--SSL Disabled	(3286af2d-16ce-4435-a08b-687d1991da42) BeginTx returned: FailInvalidToken 
----03/10/2011 14:23:07      paulh--89.0.1.165(89.0.1.165)--SSL Disabled		(3286af2d-16ce-4435-a08b-687d1991da42) CopyBranch: $/Dev to $/Developer Branches/PaulH/48631 returned: nil 

jvel
Posts: 27
Joined: Wed Mar 09, 2011 8:51 am
Location: UK

Re: Deadlocks

Post by jvel » Mon Oct 03, 2011 11:09 am

I should also have said, I'm happy to send our server logs, full or partial, if they would be helpful. I'm also happy to enable client logging if you tell me which settings (eg classesToLog) we should use.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Deadlocks

Post by Beth » Mon Oct 03, 2011 1:11 pm

This will need more in-depth troubleshooting to find out what is happening here. Could you send an email to support at sourcegear.com (attn: Beth) with a link to this forum thread? Also, please attach your Vault server log to that email.
Beth Kieler
SourceGear Technical Support

jvel
Posts: 27
Joined: Wed Mar 09, 2011 8:51 am
Location: UK

Re: Deadlocks

Post by jvel » Tue Oct 04, 2011 4:35 am

Ok thanks, I have emailed.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Deadlocks

Post by Beth » Tue Oct 04, 2011 9:00 am

I've received the email and will be replying offline.

HS: 224079
Beth Kieler
SourceGear Technical Support

Post Reply