Page MenuHomePhabricator

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

Authored by epriestley on Sep 7 2016, 5:51 PM.
Tags
None
Referenced Files
F14053608: D16514.diff
Fri, Nov 15, 5:53 PM
F14048016: D16514.id39746.diff
Thu, Nov 14, 6:25 AM
F14045834: D16514.id39746.diff
Wed, Nov 13, 1:06 PM
F14042176: D16514.diff
Tue, Nov 12, 1:10 AM
F14033381: D16514.id.diff
Sat, Nov 9, 5:34 PM
F14032878: D16514.id.diff
Sat, Nov 9, 4:05 PM
F14031922: D16514.id39746.diff
Sat, Nov 9, 12:16 PM
F14031921: D16514.id39743.diff
Sat, Nov 9, 12:16 PM
Subscribers
None

Details

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.

Screen Shot 2016-09-07 at 10.45.55 AM.png (987×1 px, 198 KB)

Diff Detail

Repository
rP Phabricator
Branch
xobjrace
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 13622
Build 17554: Run Core Tests
Build 17553: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to Recover from a race when importing external objects (like JIRA issues) for the first time.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Sep 7 2016, 6:08 PM
This revision was automatically updated to reflect the committed changes.