RFR: 1035: Race when creating backports for bug spanning multiple repos
Erik Joelsson
erikj at openjdk.org
Thu Feb 16 14:21:43 UTC 2023
On Thu, 16 Feb 2023 01:44:21 GMT, vijayk22oracle <duke at openjdk.org> wrote:
> SKARA-1035: Race when creating backports for bug spanning multiple repos
bots/notify/src/main/java/org/openjdk/skara/bots/notify/issue/IssueNotifier.java line 310:
> 308: try {
> 309: issue = jbsBackport.createBackport(issue, requestedVersion, username.orElse(null), defaultSecurity(branch));
> 310: } catch (Exception exp) {
Catching `Exception` is too wide a net. We need to catch `UncheckedRestException` and ideally check that the response code indicates this kind of error. Unfortunately I don't know what response that would be, so perhaps it's ok to just change the exception type for now.
Exception variables in catch statements are usually just called `e` in this codebase.
bots/notify/src/main/java/org/openjdk/skara/bots/notify/issue/IssueNotifier.java line 313:
> 311: existing = Backports.findIssue(issue, fixVersion);
> 312: if (existing.isPresent()) {
> 313: log.info("Race condition occurred while creating the back port. So returning an existing backport for " + issue.id() + " and requested fixVersion "
Suggestion:
log.info("Race condition occurred while creating backport issue, returning the existing backport for " + issue.id() + " and requested fixVersion "
-------------
PR: https://git.openjdk.org/skara/pull/1476
More information about the skara-dev
mailing list