RFR: 2340: CommitCommentsWorkItem executing in GitLab takes a lot of time.

Erik Joelsson erikj at openjdk.org
Fri Aug 9 19:46:30 UTC 2024


On Mon, 29 Jul 2024 17:44:54 GMT, Zhao Song <zsong at openjdk.org> wrote:

> Currently, if a user comments under a commit named "Merge" in GitLab, the CommitCommentsWorkItem will take about 8 hours to complete. This delay occurs because the Skara bot checks all commits named "Merge" in the repository.
> 
> In the previous implementation, the bot fetched all the commit comments for all candidates and then attempted to find the one with the correct ID. With my patch, the bot now fetches the commit comment for only one candidate at a time and looks for the correct ID.

forge/src/main/java/org/openjdk/skara/forge/gitlab/GitLabRepository.java line 560:

> 558:         // eventually clear up on subsequent tries.
> 559:         Optional<CommitComment> found = Optional.empty();
> 560:         for (var candidate : candidates) {

Are you sure this makes a difference? Streams, or at least flatMap, aren't supposed to be eager, so I was expecting the current implementation to do exactly the same thing.

-------------

PR Review Comment: https://git.openjdk.org/skara/pull/1682#discussion_r1712058904


More information about the skara-dev mailing list