Page MenuHomePhabricator

In Harbormaster, make sure artifacts are destroyed even if a build is aborted
ClosedPublic

Authored by epriestley on Oct 4 2015, 5:56 PM.
Tags
None
Referenced Files
F15479747: D14234.id.diff
Tue, Apr 8, 9:12 AM
F15472870: D14234.diff
Sat, Apr 5, 5:06 PM
F15448365: D14234.id34372.diff
Fri, Mar 28, 4:28 AM
F15436200: D14234.id.diff
Tue, Mar 25, 12:31 PM
F15435475: D14234.id34371.diff
Tue, Mar 25, 8:29 AM
F15430133: D14234.diff
Mon, Mar 24, 6:03 AM
F15421724: D14234.id.diff
Sat, Mar 22, 1:52 AM
Unknown Object (File)
Feb 14 2025, 3:44 AM
Subscribers
None

Details

Summary

Ref T9252. Currently, Harbormaster and Drydock work like this in some cases:

  1. Queue a lease for activation.
  2. Then, a little later, save the lease PHID somewhere.
  3. When the target/resource is destroyed, destroy the lease.

However, something can happen between (1) and (2). In Drydock this window is very short and the "something" would have to be a lighting strike or something similar, but in Harbormaster we wait until the resource activates to do (2) so the window can be many minutes long. In particular, a user can use "Abort Build" during those many minutes.

If they do, the target is destroyed but it doesn't yet have a record of the artifact, so the artifact isn't cleaned up.

Make these things work like this instead:

  1. Create a new lease and pre-generate a PHID for it.
  2. Save that PHID as something that needs to be cleaned up.
  3. Queue the lease for activation.
  4. When the target/resource is destroyed, destroy the lease if it exists.

This makes sure there's no step in the process where we might lose track of a lease/resource.

Also, clean up and standardize some other stuff I hit.

Test Plan
  • Stopped daemons.
  • Restarted a build in Harbormaster.
  • Stepped through the build one stage at a time using bin/worker execute ....
  • After the lease was queued, but before it activated, aborted the build.
  • Processed the Harbormaster side of things only.
  • Saw the lease get destroyed properly.

Diff Detail

Repository
rP Phabricator
Branch
ddoc1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 8182
Build 9351: Run Core Tests
Build 9350: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to In Harbormaster, make sure artifacts are destroyed even if a build is aborted.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: chad, hach-que.
hach-que edited edge metadata.
This revision is now accepted and ready to land.Oct 5 2015, 12:30 AM
This revision was automatically updated to reflect the committed changes.