我们可以告诉 CruiseControl.NET 忽略源代码管理超时错误吗?

发布于 2024-08-18 14:45:18 字数 1359 浏览 3 评论 0原文

我们设置了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

过去的过去 2024-08-25 14:45:18

这是我用来防止影响构建状态的此类错误的块:

<maxSourceControlRetries>5</maxSourceControlRetries>
<stopProjectOnReachingMaxSourceControlRetries>true</stopProjectOnReachingMaxSourceControlRetries>
<sourceControlErrorHandling>ReportOnRetryAmount</sourceControlErrorHandling>

您需要将它们放在 标记的正下方,而不是 。不过,我不确定您是否能够忽略“超时”异常 - 所有 SVN 异常都会被同等对待。

更新:您可以在 CC.NET 文档中找到有关这些设置的更多信息,但让我复制相关内容:

ma​​xSourceControlRetries:在项目进入停止状态之前(当 stopProjectOnReachingMaxSourceControlRetries 设置为 true 时),可能发生的连续源代码控制异常的最大数量。

stopProjectOnReachingMaxSourceControlRetries:在达到 maxSourceControlRetries 或未达到时停止项目。当设置为 true 时,当连续源代码控制错误数量等于 maxSourceControlRetries 时,项目将停止。

sourceControlErrorHandling:发生源代码控制错误时(在 GetModifications 期间)采取什么操作。这些是可能的值:

  • ReportEveryFailure :每当出现错误时运行发布者部分
  • ReportOnRetryAmount :仅在达到 maxSourceControlRetries 时运行发布者部分,发布者部分将仅运行一次。
  • ReportOnEveryRetryAmount :每当达到 maxSourceControlRetries 时运行发布者部分。当达到 maxSourceControlRetries 且发布者部分已运行时,计数器将设置回 0。

Here's a block I use to prevent these kinds of errors affecting the build status:

<maxSourceControlRetries>5</maxSourceControlRetries>
<stopProjectOnReachingMaxSourceControlRetries>true</stopProjectOnReachingMaxSourceControlRetries>
<sourceControlErrorHandling>ReportOnRetryAmount</sourceControlErrorHandling>

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 :

  • ReportEveryFailure : runs the publisher section whenever there is an error
  • ReportOnRetryAmount : only runs the publisher section when maxSourceControlRetries has been reached, the publisher section will only be run once.
  • ReportOnEveryRetryAmount : runs the publisher section whenever the maxSourceControlRetries has been reached. When maxSourceControlRetries has been reached and the publisher section has ran, the counter is set back to 0.
夜声 2024-08-25 14:45:18

你不能增加“超时”值吗?

<sourcecontrol>
   ...
   <timeout>60000</timeout> <!-- timeout in milliseconds -->
   ...
</sourcecontrol>

Can't you just increase the 'timeout' value ?

<sourcecontrol>
   ...
   <timeout>60000</timeout> <!-- timeout in milliseconds -->
   ...
</sourcecontrol>
纵情客 2024-08-25 14:45:18

除了已接受的答案之外。我发现使用 url 触发器对我们帮助很大。

<triggers>
  <urlTrigger url="http://url.to.your.svn.server" />
</triggers>

因此,如果服务器无法访问,CCNet 将不会触发构建。这有效地减少了失败的机会。

URI 触发器文档链接

更新:在上述线路实施近 2 个月后,我们从未遇到过因 svn 服务器连接问题而导致的错误故障。

In addition to the accepted answer. I found it helped us a lot by using url trigger.

<triggers>
  <urlTrigger url="http://url.to.your.svn.server" />
</triggers>

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文