Skip to content

Multiple links to the same PR 聽#12

Closed

Description

@Mariatta

This was opened in python/core-workflow#224, but it is more appropriate here:

馃崫 (copy pasta)

In bpo-32856 you can see that the bot created two links to the same PR python/cpython#5695. I suppose this happened because I fixed a typo in the title just after creating the PR. But I wondering if there is a race condition which can cause more several errors.

Activity

  1. JulienPalard commented on Dec 27, 2018

    @JulienPalard
    Member

    Happened again here: https://bugs.python.org/issue35579 with 4 links to the same PR.

  2. Mariatta commented on Dec 27, 2018

    @Mariatta
    MemberAuthor

    It could be related to the bpo maintenance recently, where Ernest had to replay all of the failed webhook deliveries. python/core-workflow#301

  3. terryjreedy commented on Dec 27, 2018

    @terryjreedy
    Member

    If you hit a link [edit] button, you can unlink, but I don't know if just 1 or all 4 would be affected. The duplicate merge reports can be deleted 1 by 1 if you want to clean the issue for future viewers.

  4. serhiy-storchaka commented on Dec 27, 2018

    @serhiy-storchaka
    Member

    Just 1 will be unlinked. You need to unlink them 1 by 1. I did this many times, and it is tiresome.

  5. changed the title [-]Double link to the same PR [/-] [+]Multiple links to the same PR [/+] on Dec 31, 2018
  6. ned-deily commented on Dec 31, 2018

    @ned-deily
    Member

    AFAICT, this now seems to be happening for all PRs with b.p.o references, with 3 identical PR links being created. See, for example, https://bugs.python.org/issue35614. @ewdurbin @ezio-melotti

    screen shot 2018-12-31 at 00 46 56

  7. gpshead commented on Dec 31, 2018

    @gpshead
    Member

    fwiw, it isn't always three, i believe I've seen four happen today.

  8. ewdurbin commented on Dec 31, 2018

    @ewdurbin
    Member

    It appears to be a race condition on these statements: https://bitbucket.org/python/roundup/src/45440a8172b155875eb4daecd44104abe03b49d3/roundup/github.py#lines-200:201

    https://bitbucket.org/python/roundup/src/45440a8172b155875eb4daecd44104abe03b49d3/roundup/github.py#lines-228

    If the handler is slow, and multiple web hooks are being processed simultaneously for the same PR they each helpfully create the object in the database.

    Investigating if there is a reasonable way to handle this.

  9. Mariatta commented on Dec 31, 2018

    @Mariatta
    MemberAuthor

    Is this something that will go away if we start using GitHub issues?

  10. tirkarthi commented on Jan 2, 2019

    @tirkarthi
    Member

    I guess this also affects keywords. After a PR is added to the issue every message repeats the keyword patch thrice per message in the activity log. Example : https://bugs.python.org/issue35603 .

    screen shot 2019-01-02 at 6 35 47 pm

  11. ewdurbin commented on Jan 3, 2019

    @ewdurbin
    Member
  12. vstinner commented on Jan 4, 2019

    @vstinner
    Member

    I will follow this issue since the bug is annoying. It sends me useless email notifications and not all duplicated PRs get updated when a PR is merged or rejected.

  13. tirkarthi commented on Jan 23, 2019

    @tirkarthi
    Member

    Is this possibly due to the extra workers that were spin up during the maintenance causing duplicate PRs to be created always since the race condition exists for a very long time? Subscribing to python-bugs-list sends a lot of duplicate notifications and emails for PRs sometimes causes actual messages to be overlooked if there are multiple backports created at the same time for the issue.

  14. pitrou commented on Feb 3, 2019

    @pitrou
    Member

    @ewdurbin If pull_request.setkey('number') creates a unique key (I'm not acquainted with the Roundup DB layer), then the solution looks reasonable on the principle (and pretty much idiomatic, IMHO). But you probably shouldn't re-do prs.append(pr) if the PR was already there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions