RFR: 1682: PullRequestBot::getPeriodicItems takes too long [v2]

Erik Joelsson erikj at openjdk.org
Fri Nov 18 18:01:22 UTC 2022

> Similar to the NotifyBot in [SKARA-1680](https://bugs.openjdk.org/browse/SKARA-1680), the PullRequestBot is also suffering from spending a very long time in the very first round of getPeriodicItems after a bot restart. The last time we redeployed this bot, it took ~40 minutes. This was long enough to trigger several users to ask if Skara was having issues.
> The cause is similar. There is an `isReady` call for each PR, which checks for comments. The comment checking here is even worse than for the NotifyBot because every PR is checked for comments, not just those that match the "rfr" or "integrated" labels.
> My proposed solution is similar. We need to move this expensive evaluation to the relevant WorkItems where they can run concurrently instead of serially in `getPeriodicItems`. I chose to make the call from the abstract superclass `PullRequestWorkItem`. This does add the check unnecessarily to the `LabelerWorkItem`, but that one is running so rarely that I don't think it matters performance wise. For correctness, I don't think it hurts checking an extra time.

Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision:

  Movking isReady to PullRequestWorkItem. Introducing readyCheckNeeded.


  - all: https://git.openjdk.org/skara/pull/1423/files
  - new: https://git.openjdk.org/skara/pull/1423/files/1ead6076..43272b56

 - full: https://webrevs.openjdk.org/?repo=skara&pr=1423&range=01
 - incr: https://webrevs.openjdk.org/?repo=skara&pr=1423&range=00-01

  Stats: 91 lines in 5 files changed: 46 ins; 30 del; 15 mod
  Patch: https://git.openjdk.org/skara/pull/1423.diff
  Fetch: git fetch https://git.openjdk.org/skara pull/1423/head:pull/1423

PR: https://git.openjdk.org/skara/pull/1423

More information about the skara-dev mailing list