Skip to content

Possible race condition when marking build status #41

@terabyte

Description

@terabyte

I have no clue how this happened, but a pull request got into a broken state where it was obviously a successful build, but it still said "cannot merge, build in progress". When I examined the DB, I found this:

stash=# select * from  "AO_B11572_PRMETADATA001" where "PULL_REQUEST_ID" = 123;                                                                                                                                                                                                                       
 BUILD_STARTED |                 FROM_SHA                 | ID  | OVERRIDE | PULL_REQUEST_ID | REPO_ID | SUCCESS |                  TO_SHA                  | FAILED 
---------------+------------------------------------------+-----+----------+-----------------+---------+---------+------------------------------------------+--------
 t             | 30b0f516548ffd4be3bc89520784b110f3ae3c2b | 460 | f        |             123 |      64 | f       | 2246f5d53a5ffd90115223b65759f794d8cc2e17 | f
 t             | 30b0f516548ffd4be3bc89520784b110f3ae3c2b | 459 | f        |             123 |      64 | t       | 2246f5d53a5ffd90115223b65759f794d8cc2e17 | f
(2 rows)

It looks like we ended up with two rows, possibly due to a race condition. Instead of updating hte existing row a new one was made. I couldn't get any logs or better info about what happened.

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