RFR: 1035: Race when creating backports for bug spanning multiple repos [v2]

Vijay Kulkarni duke at openjdk.org
Thu Feb 16 17:16:52 UTC 2023


On Thu, 16 Feb 2023 14:16:19 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> Vijay Kulkarni has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Caught more specific exception in case of backport fails & updated error message.
>
> 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.

Yes, I agree, used the more specific exception as suggested.

Regarding the specific exception code, yes I tried to run two test cases in parallel by putting the debug points to simulate the race condition but TestHost returned 2nd issue as a new one. I guess because of two instances of TestHost (one per test case). So could not verify the exception code.

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

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


More information about the skara-dev mailing list