tfsaggregator / tfsaggregator-webhooks

WARNING: the team is no more maintaing this version. See aggreggator-cli instead.
https://github.com/tfsaggregator/aggregator-cli
19 stars 22 forks source link

Error. A task was canceled. #30

Closed arpsyapathy closed 5 years ago

arpsyapathy commented 6 years ago

Hello!

Periodically, webhook in TFS reports an error:

A task was canceled.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at Microsoft.VisualStudio.Services.ServiceHooks.Common.HttpActionTask.<RunAsync>d__8.MoveNext()

These errors occur in the Feature. Judging by the logs, they occur when attaching child elements

My policies:

<?xml version="1.0" encoding="utf-8"?>
<AggregatorConfiguration>

  <runtime debug="true">
    <rateLimiting interval="00:00:30.00" changes="1000" />
    <logging level="Diagnostic" />
    <script language="C#" />
    <!--
    <authentication username="**DOMAIN**\**user**" password="***" />
    <authentication personalToken="**put-personal-token-here**" />
    -->
  </runtime>

  <rule name="SetEpic" hasFields="My.TargetRelease">
        <![CDATA[
        IWorkItemExposed topEpic = self.FollowingLinks("System.LinkTypes.Hierarchy-Reverse").WhereTypeIs("Epic").AtMost(1000).FirstOrDefault();
        if (topEpic != null)
        {
            string epicTitle = topEpic["Title"] as string;
            logger.Log("Parent Epic ID: {0}", topEpic.Id);
            self["My.TargetRelease"] = epicTitle;
            foreach (var x in self.Children)
            {
               x["My.TargetRelease"] = epicTitle;
            }
        }
        else
        {
      self["My.TargetRelease"] = "N/A";
            foreach (var x in self.Children)
            {
               x["My.TargetRelease"] = "N/A";
            }
        }
        ]]>
  </rule>
  <policy name="MyPolicy">
    <ruleRef name="SetEpic" />
  </policy>

</AggregatorConfiguration>

Do you have any ideas how to solve the problem? Thank you all in advance

jessehouwing commented 6 years ago

That query to look up the epics looks like it could take pretty long. We currently don't have ways to increase timeouts etc.

Can't you look for epic with no parent, instead if grabbing all epics in hierarchy?

On Tue, 4 Sep 2018, 14:09 psyapathy, notifications@github.com wrote:

Hello!

Periodically, webhook in TFS reports an error:

A task was canceled. System.Threading.Tasks.TaskCanceledException: A task was canceled. at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Services.ServiceHooks.Common.HttpActionTask.d__8.MoveNext()

These errors occur in the Feature. Judging by the logs, they occur when attaching child elements

My policies:

<?xml version="1.0" encoding="utf-8"?>

Githubissues.
  • Githubissues is a development platform for aggregating issues.