Uploaded image for project: 'Skara'
  1. Skara
  2. SKARA-1191

CommitCommentWorkItem overwhelms scheduler

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.0
    • Component/s: bots
    • Labels:
      None

      Description

      Recently, we have seen the PR bot getting slowed down to a crawl, taking hours responding to updates in PRs (e.g. SKARA-1178). I believe I have finally found the cause. The scheduler is slowly getting filled up with CommitCommentWorkItems.

      A CommitCommentWorkItem is scheduled for each repository every time PullRequestBot::getPeriodicItems is called, which is every 10 seconds. So unless we are able to process these for every repository in 10 seconds, they will start to pile up. Until recently, we probably could, but the more repositories we create, the more of these get scheduled.

      The defense for this is the WorkItem::concurrentWith method, which is supposed to protect both WorkItems that touch the same data from getting into races, but also to avoid keeping duplicate WorkItems in the pending queue. In the case of CommitCommentWorkItem, ::concurrentWith just returns true, so there is no protection against flooding.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              erikj Erik Joelsson
              Reporter:
              erikj Erik Joelsson
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: