我们可以告诉 CruiseControl.NET 忽略源代码管理超时错误吗?
我们设置了 CruiseControl.NET 来持续集成我们的许多项目。
我们使用
块来确保所有源代码控制操作都以相同的方式完成,并保持配置干燥。
我们偶尔会遇到一个导致构建显示“异常”的问题。消息如下:
ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation has timed out.
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.ProcessSourceControl.Execute(ProcessInfo processInfo)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Svn.GetModifications(IIntegrationResult from, IIntegrationResult to)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.QuietPeriod.GetModifications(ISourceControl sourceControl, IIntegrationResult lastBuild, IIntegrationResult thisBuild)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.GetModifications(IIntegrationResult from, IIntegrationResult to)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest request)
公共配置部分如下:
<sourcecontrol type="svn">
<trunkUrl>http://ourserver/svn/$(project-svn-path)/trunk/</trunkUrl>
<executable>C:\Program Files\CollabNet Subversion Server\csvn.exe</executable>
<username>user</username>
<password>password<password>
<revert>true</revert>
</sourcecontrol>
如果可能的话,我想忽略这个特定错误。
我需要做出哪些改变?
We have CruiseControl.NET set up to do continuous integration of a number of our projects.
We are using a <cb:define>
block to make sure all of our source control operations are done in the same way, and to keep the config DRY.
We are experiencing an issue every once in a while that cause the build to show "Exception". The message is as follows:
ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation has timed out.
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.ProcessSourceControl.Execute(ProcessInfo processInfo)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Svn.GetModifications(IIntegrationResult from, IIntegrationResult to)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.QuietPeriod.GetModifications(ISourceControl sourceControl, IIntegrationResult lastBuild, IIntegrationResult thisBuild)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.GetModifications(IIntegrationResult from, IIntegrationResult to)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest request)
The common config section is as follows:
<sourcecontrol type="svn">
<trunkUrl>http://ourserver/svn/$(project-svn-path)/trunk/</trunkUrl>
<executable>C:\Program Files\CollabNet Subversion Server\csvn.exe</executable>
<username>user</username>
<password>password<password>
<revert>true</revert>
</sourcecontrol>
I would like to ignore this specific error, if possible.
What changes do I need to make?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是我用来防止影响构建状态的此类错误的块:
您需要将它们放在
标记的正下方,而不是
。不过,我不确定您是否能够忽略“超时”异常 - 所有 SVN 异常都会被同等对待。更新:您可以在 CC.NET 文档中找到有关这些设置的更多信息,但让我复制相关内容:
maxSourceControlRetries:在项目进入停止状态之前(当 stopProjectOnReachingMaxSourceControlRetries 设置为 true 时),可能发生的连续源代码控制异常的最大数量。
stopProjectOnReachingMaxSourceControlRetries:在达到 maxSourceControlRetries 或未达到时停止项目。当设置为 true 时,当连续源代码控制错误数量等于 maxSourceControlRetries 时,项目将停止。
sourceControlErrorHandling:发生源代码控制错误时(在 GetModifications 期间)采取什么操作。这些是可能的值:
Here's a block I use to prevent these kinds of errors affecting the build status:
You need to put these right below the
<project>
tag, not the<sourcecontrol>
. I'm not sure you'll be able to ignore just the "timed out" exception, though - all SVN exceptions will be treated the same.UPDATE: you can find out more about these settings in the CC.NET documentation, but let me copy the relevant stuff:
maxSourceControlRetries: The maximum amount of source control exceptions in a row that may occur, before the project goes to the stopped state(when stopProjectOnReachingMaxSourceControlRetries is set to true).
stopProjectOnReachingMaxSourceControlRetries: Stops the project on reaching maxSourceControlRetries or not. When set to true, the project will be stopped when the amount of consecutive source control errors is equal to maxSourceControlRetries.
sourceControlErrorHandling: What action to take when a source control error occurs (during GetModifications). These are the possible values :
你不能增加“超时”值吗?
Can't you just increase the 'timeout' value ?
除了已接受的答案之外。我发现使用 url 触发器对我们帮助很大。
因此,如果服务器无法访问,CCNet 将不会触发构建。这有效地减少了失败的机会。
URI 触发器文档链接。
更新:在上述线路实施近 2 个月后,我们从未遇到过因 svn 服务器连接问题而导致的错误故障。
In addition to the accepted answer. I found it helped us a lot by using url trigger.
So if the server is not reachable, CCNet won't event trigger a build. That effectively reduced the chance of failures.
Link to Documentation of URI Trigger.
Update: we never had a single false failure caused by svn server connectivity issue after above line was in place for near 2 months.