Homec4science

Recover from a race when importing external objects (like JIRA issues) for the…

Authored by epriestley <git@epriestley.com> on Sep 7 2016, 19:46.

Description

Recover from a race when importing external objects (like JIRA issues) for the first time

Summary:
Fixes T11604. If we send two requests to render a brand new tag at about the same time (say, 50ms apart) but JIRA takes more than 50ms to return from its API call, the two processes will race one another and try to save the same external object.

If they do, have whichever one lost the race just load the object the other one created.

Apply this to other bridges, too.

Test Plan:

  • Created a new task in JIRA.
  • Referenced it for the first time in Differential, in a comment.
  • This causes two tag renders to fire. This might be a bug but I spend 30 seconds on it without figuring out what was up. Regardless, we should fix the race even if the reason it's triggering so easily legitimately is a bug.
  • Before patch: big error dialog (as in T11604).
  • After patch: smooth sailing.

{F1804008}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11604

Differential Revision: https://secure.phabricator.com/D16514

Details

Committed
epriestley <git@epriestley.com>Sep 7 2016, 20:16
Pushed
aubortJan 31 2017, 17:16
Parents
rPHe2430d0aa534: Add a few more high contrast CSS rules
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH138efb2b1035: Recover from a race when importing external objects (like JIRA issues) for the… (authored by epriestley <git@epriestley.com>).Sep 7 2016, 20:16