Integrated: 1962: JiraProject#queryIssues may return duplicate issues

Zhao Song zsong at openjdk.org
Wed Oct 25 20:28:48 UTC 2023


On Tue, 24 Oct 2023 17:46:39 GMT, Zhao Song <zsong at openjdk.org> wrote:

> Since [SKARA-1912](https://bugs.openjdk.org/browse/SKARA-1912) deployed into prod, we have noticed occurrences of duplicate key exceptions in the IssueProjectPoller#updatedIssues.
> 
> After investigation, we found that `JiraProject#queryIssues` may return duplicate issues and I think the pagination in this method is the root cause.
> 
> The problem here is that, sometimes, issues will be updated during the pagination process. For example, the default page size is 50 and we assume that issue#50 is the last issue in the first page. And before querying the second page, another issue which not in the first page got updated, so issue#50 will also be the first issue in the second page. Therefore, the method may return duplicate issues.
> 
> Erik's solution is right. We just need to order by updatedTime DESC and remove the duplicate issues. Ordering by updatedTime DESC would make sure that even some issues are updated during the pagination, the issues will be processed in the future round.

This pull request has now been integrated.

Changeset: 4c3c83a6
Author:    Zhao Song <zsong at openjdk.org>
URL:       https://git.openjdk.org/skara/commit/4c3c83a684f16b63a3a49f89177a6a34a30df2df
Stats:     12 lines in 1 file changed: 5 ins; 0 del; 7 mod

1962: JiraProject#queryIssues may return duplicate issues

Reviewed-by: erikj

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

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


More information about the skara-dev mailing list