TFS - 测试管理仓库同步 - SQL超时

时间:2014-07-15 00:44:02

标签: sql-server tfs tfs2013 data-warehouse

自从我们升级TFS 2013 - TFS 2013更新2后,我们的“测试管理仓库”无法同步。它会在1小时后抛出SQL超时。

我们运行了很多自动化测试,因此我们的测试管理仓库相当大。

Here is a thread to a microsoft issue关于同样的事情,但对于“Build Warehouse Sync” - 我的猜测是同样的问题,但是我们没有很多版本,但有大量的测试。

我尝试和修复过的事情:

  1. 运行完整的重建(丢弃仓库并重新启动)
    • 没效果
  2. 重建tfs_defaultcollection上的所有索引
    • 查询现在运行得更快但对问题没有影响
  3. 将超时“WarehouseCommandSqlTimeout”从1小时增加到3小时
    • 1小时后仍然失败,所以我的猜测是某个地方有一个小时的全局SQL连接超时?
  4. 作为现在的修补程序,id喜欢将SQL连接超时增加到3小时,看看是否有所作为。有谁知道那个设置在哪里?

    这是错误:

    [Test Management Warehouse Sync]: ---> Microsoft.TeamFoundation.Warehouse.WarehouseException: TF221122: An error occurred running job Test Management Warehouse Sync for team project collection or Team Foundation server DefaultCollection. ---> Microsoft.TeamFoundation.Framework.Server.DatabaseOperationTimeoutException: TF246018: The database operation exceeded the timeout limit and has been cancelled. Verify that the parameters of the operation are correct. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out --- End of inner exception stack trace --- at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() 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, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.Execute(ExecuteType executeType, CommandBehavior behavior) --- End of inner exception stack trace --- at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.TranslateException(Int32 errorNumber, SqlException sqlException, SqlError sqlError) at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.TranslateException(SqlException sqlException) at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.MapException(SqlException ex, QueryExecutionState queryState) at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.HandleException(Exception exception) at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.Execute(ExecuteType executeType, CommandBehavior behavior) at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.ExecuteReader() at Microsoft.TeamFoundation.TestManagement.Warehouse.WarehouseResultDatabase.QueryTestPointData(SqlBinary watermark, Int32 limit, ProcessRowCallback deletedCallback, ProcessMappingDataCallback addedCallback, ResolveIdentities resolveIdentitiesCallBack) at Microsoft.TeamFoundation.TestManagement.Warehouse.TeamTestWarehouseAdapter.QueryForTestPoints(WarehouseResultDatabase wrd, SqlBinary waterMark, Int32 limit) at Microsoft.TeamFoundation.TestManagement.Warehouse.TeamTestWarehouseAdapter.ProcessIntegratedResults(WarehouseRowVersionQueryDelegate wqd, String highWaterMarkProperty, String processLimitProperty, Int32 defaultLimit) at Microsoft.TeamFoundation.TestManagement.Warehouse.TeamTestWarehouseAdapter.MakeDataChanges() at Microsoft.TeamFoundation.Warehouse.WarehouseSyncJobExtension1.MakeDataChanges(TeamFoundationRequestContext requestContext, TeamFoundationJobDefinition jobDefinition, String& resultMessage) at Microsoft.TeamFoundation.Warehouse.WarehouseSyncJobExtension1.RunInternal(TeamFoundationRequestContext requestContext, TeamFoundationJobDefinition jobDefinition, DateTime queueTime, String& resultMessage) at Microsoft.TeamFoundation.Warehouse.WarehouseJobExtension.Run(TeamFoundationRequestContext requestContext, TeamFoundationJobDefinition jobDefinition, DateTime queueTime, String& resultMessage) --- End of inner exception stack trace ---

1 个答案:

答案 0 :(得分:0)

您可以通过更改TFSJobAgent.exe.config文件来更改作业代理的日志记录。它可以在这里找到: -

C:\ Program Files \ Microsoft Team Foundation Server 12.0 \ Application Tier \ TFSJobAgent

 <system.diagnostics>
    <trace autoflush="false" indentsize="4">
      <!--To enable tracing to file, simply uncomment listeners section and set trace switch(es) below.
          Directory specified for TextWriterTraceListener output must exist, and job agent service account must have write permissions. -->
      <!--<listeners>
        <add name="myListener" 
          type="System.Diagnostics.TextWriterTraceListener" 
          initializeData="C:\Replace_Me_With_A_Directory_The_Service_Account_Can_Write_To\jobagent.log" />
        <remove name="Default" />
      </listeners>-->
    </trace>
    <switches>
      <!--  Trace Switches
            Each of the trace switches should be set to a value between 0 and 4, inclusive.
              0: No trace output
              1-4: Increasing levels of trace output; see Systems.Diagnostics.TraceLevel-->
      <add name="API" value="0" />
      <add name="Authentication" value="0" />
      <add name="Authorization" value="0" />
      <add name="Database" value="0" />
      <add name="General" value="0" />
      <add name="traceLevel" value="0" />
    </switches> 
   </system.diagnostics>

这可能会为您提供更好的诊断方法来调查问题

有关超时设置,请参阅http://msdn.microsoft.com/en-us/library/ff458305.aspx