RFR: 1658: Minimize race window when updating PR body [v2]

Erik Joelsson erikj at openjdk.org
Tue Nov 29 23:57:40 UTC 2022

On Tue, 29 Nov 2022 23:44:32 GMT, Zhao Song <zsong at openjdk.org> wrote:

>> bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java line 747:
>>> 745:         } else {
>>> 746:             log.info("PR body has been modified, won't update PR body this time");
>>> 747:             return description;
>> If we detect concurrent modification, we have to fail the WorkItem so that it gets scheduled for a retry. To make that happen, throw RuntimeException.
> I thought the body will be updated in next round, so I didn't throw exception here.  Why is retry here better than updating body in next round?

Hm, you are right, if the body has been updated since this CheckRun was triggered, we will get another one scheduled anyway. Since this isn't actually a failure condition, it's better to not throw exceptions that will annoy admins.


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

More information about the skara-dev mailing list