RFR: 2556: LablerWorkItem adds unnecessary overhead when the bot restarts
Erik Joelsson
erikj at openjdk.org
Wed Aug 6 21:47:13 UTC 2025
On Wed, 6 Aug 2025 21:11:22 GMT, Zhao Song <zsong at openjdk.org> wrote:
> In [SKARA-2408](https://bugs.openjdk.org/browse/SKARA-2408) and [SKARA-2552](https://bugs.openjdk.org/browse/SKARA-2552), I updated the bot to do one more CheckWorkItem with force update after a pr is marked as auto labeled.
>
> Currently, when the pr bot restarts, the bot would schedule a PullRequestCommandWorkItem for every pr(including closed prs), in the end of PullRequestCommandWorkItem, a LabelerWorkItem will be scheduled for each pr as well. In the LabelerWorkItem, when it finds the bot doesn't have label configuration, the bot will mark the pr as auto labelled and schedule a CheckWorkItem with forceUpdate. This is the issue, the bot shouldn't schedule any CheckWorkItem when the bot doesn't have label configuration. Otherwise, the bot would re-evaluate all the prs with forceUpdate.
>
> Also, if the pr is already closed, the LabelerWorkItem shouldn't schedule any CheckWorkItem for it.
bots/pr/src/main/java/org/openjdk/skara/bots/pr/LabelerWorkItem.java line 125:
> 123:
> 124: if (bot.isAutoLabelled(pr) || pr.isClosed()) {
> 125: return List.of();
Having this check is good, but I think we should also check `!pr.isClosed()` before even creating a `LablerWorkItem` in `PullRequestCommandWorkItem`. That should help alleviate even more startup congestion.
-------------
PR Review Comment: https://git.openjdk.org/skara/pull/1729#discussion_r2258385903
More information about the skara-dev
mailing list